TF-295 Apply new UI for composer web browser

This commit is contained in:
dab246
2022-03-16 15:57:59 +07:00
committed by Dat H. Pham
parent 8c66ef9105
commit 1f9fd7c0a7
38 changed files with 1181 additions and 219 deletions
@@ -2,7 +2,9 @@
import 'package:core/core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:model/model.dart';
import 'package:tmail_ui_user/main/routes/app_routes.dart';
typedef OnBackActionClick = void Function();
typedef OnEmailActionClick = void Function(PresentationEmail, EmailActionType);
@@ -51,9 +53,9 @@ class AppBarMailWidgetBuilder {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
children: [
if ((!_responsiveUtils.isDesktop(_context) && !_responsiveUtils.isTabletLarge(_context)))
if (_conditionShowBackButton())
_buildBackButton(),
if ((!_responsiveUtils.isDesktop(_context) && !_responsiveUtils.isTabletLarge(_context)))
if (_conditionShowBackButton())
Expanded(child: _buildMailboxName()),
if (_presentationEmail != null) _buildListOptionButton(),
]
@@ -62,6 +64,16 @@ class AppBarMailWidgetBuilder {
);
}
bool _conditionShowBackButton() {
if (Get.currentRoute == AppRoutes.MAILBOX_DASHBOARD) {
return !_responsiveUtils.isDesktop(_context) && !_responsiveUtils.isTabletLarge(_context);
} else if (Get.currentRoute == AppRoutes.EMAIL) {
return _responsiveUtils.isMobileDevice(_context) || _responsiveUtils.isTablet(_context);
} else {
return false;
}
}
Widget _buildBackButton() {
return IconButton(
icon: SvgPicture.asset(_imagePaths.icBack, width: 20, height: 20, color: AppColor.colorTextButton, fit: BoxFit.fill),
@@ -78,7 +78,7 @@ class AttachmentFileTileBuilder {
}},
leading: Transform(
transform: Matrix4.translationValues(14.0, 2.0, 0.0),
child: SvgPicture.asset(_imagePaths.icAttachmentFile, width: 24, height: 24, fit: BoxFit.fill)),
child: SvgPicture.asset(_imagePaths.icFileAttachment, width: 24, height: 24, fit: BoxFit.fill)),
title: Transform(
transform: Matrix4.translationValues(-8.0, -8.0, 0.0),
child: Text(