TF-2261 Fix app bar email view broken
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 5e26472141f1f4562f4e7e75034c4566dcd9351b)
This commit is contained in:
@@ -55,12 +55,44 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
backgroundColor: responsiveUtils.isWebDesktop(context)
|
backgroundColor: responsiveUtils.isWebDesktop(context)
|
||||||
? AppColor.colorBgDesktop
|
? AppColor.colorBgDesktop
|
||||||
: Colors.white,
|
: Colors.white,
|
||||||
body: Row(children: [
|
appBar: PlatformInfo.isIOS
|
||||||
if (_supportVerticalDivider(context))
|
? PreferredSize(
|
||||||
const VerticalDivider(
|
preferredSize: const Size(double.infinity, 100),
|
||||||
color: AppColor.lineItemListColor,
|
child: Obx(() {
|
||||||
width: 12),
|
if (controller.currentEmail != null) {
|
||||||
Expanded(child: SafeArea(
|
return SafeArea(
|
||||||
|
top: false,
|
||||||
|
bottom: false,
|
||||||
|
child: EmailViewAppBarWidget(
|
||||||
|
key: const Key('email_view_app_bar_widget'),
|
||||||
|
presentationEmail: controller.currentEmail!,
|
||||||
|
mailboxContain: _getMailboxContain(controller.currentEmail!),
|
||||||
|
isSearchActivated: controller.mailboxDashBoardController.searchController.isSearchEmailRunning,
|
||||||
|
onBackAction: () => controller.closeEmailView(context),
|
||||||
|
onEmailActionClick: (email, action) => controller.handleEmailAction(context, email, action),
|
||||||
|
onMoreActionClick: (email, position) {
|
||||||
|
if (position == null) {
|
||||||
|
controller.openContextMenuAction(
|
||||||
|
context,
|
||||||
|
_emailActionMoreActionTile(context, email)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
controller.openPopupMenuAction(
|
||||||
|
context,
|
||||||
|
position,
|
||||||
|
_popupMenuEmailActionTile(context, email)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
body: SafeArea(
|
||||||
right: responsiveUtils.isLandscapeMobile(context),
|
right: responsiveUtils.isLandscapeMobile(context),
|
||||||
left: responsiveUtils.isLandscapeMobile(context),
|
left: responsiveUtils.isLandscapeMobile(context),
|
||||||
bottom: !PlatformInfo.isIOS,
|
bottom: !PlatformInfo.isIOS,
|
||||||
@@ -77,6 +109,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
final currentEmail = controller.currentEmail;
|
final currentEmail = controller.currentEmail;
|
||||||
if (currentEmail != null) {
|
if (currentEmail != null) {
|
||||||
return Column(children: [
|
return Column(children: [
|
||||||
|
if (!PlatformInfo.isIOS)
|
||||||
Obx(() => EmailViewAppBarWidget(
|
Obx(() => EmailViewAppBarWidget(
|
||||||
key: const Key('email_view_app_bar_widget'),
|
key: const Key('email_view_app_bar_widget'),
|
||||||
presentationEmail: currentEmail,
|
presentationEmail: currentEmail,
|
||||||
@@ -230,8 +263,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
))
|
)
|
||||||
])
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -253,16 +285,6 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _supportVerticalDivider(BuildContext context) {
|
|
||||||
if (PlatformInfo.isWeb) {
|
|
||||||
return responsiveUtils.isTabletLarge(context);
|
|
||||||
} else {
|
|
||||||
return responsiveUtils.isLandscapeTablet(context) ||
|
|
||||||
responsiveUtils.isDesktop(context) ||
|
|
||||||
responsiveUtils.isTabletLarge(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PresentationMailbox? _getMailboxContain(PresentationEmail currentEmail) {
|
PresentationMailbox? _getMailboxContain(PresentationEmail currentEmail) {
|
||||||
return currentEmail.findMailboxContain(controller.mailboxDashBoardController.mapMailboxById);
|
return currentEmail.findMailboxContain(controller.mailboxDashBoardController.mapMailboxById);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
import 'package:core/presentation/extensions/color_extension.dart';
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
import 'package:core/presentation/utils/icon_utils.dart';
|
import 'package:core/presentation/utils/icon_utils.dart';
|
||||||
|
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class EmailViewAppBarWidgetStyles {
|
class EmailViewAppBarWidgetStyles {
|
||||||
@@ -11,7 +12,13 @@ class EmailViewAppBarWidgetStyles {
|
|||||||
static const double buttonIconSize = IconUtils.defaultIconSize;
|
static const double buttonIconSize = IconUtils.defaultIconSize;
|
||||||
static const double deleteButtonIconSize = 20;
|
static const double deleteButtonIconSize = 20;
|
||||||
static const double space = 5;
|
static const double space = 5;
|
||||||
|
static double? heightIOS(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||||
|
if (responsiveUtils.isLandscapeMobile(context)) {
|
||||||
|
return 60;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
static const Color bottomBorderColor = AppColor.colorDividerHorizontal;
|
static const Color bottomBorderColor = AppColor.colorDividerHorizontal;
|
||||||
static const Color backgroundColor = Colors.white;
|
static const Color backgroundColor = Colors.white;
|
||||||
static const Color emptyTrashButtonColor = AppColor.primaryColor;
|
static const Color emptyTrashButtonColor = AppColor.primaryColor;
|
||||||
@@ -19,6 +26,15 @@ class EmailViewAppBarWidgetStyles {
|
|||||||
static const Color buttonActivatedColor = AppColor.primaryColor;
|
static const Color buttonActivatedColor = AppColor.primaryColor;
|
||||||
static const Color buttonDeactivatedColor = AppColor.colorAttachmentIcon;
|
static const Color buttonDeactivatedColor = AppColor.colorAttachmentIcon;
|
||||||
|
|
||||||
static const EdgeInsetsGeometry padding = EdgeInsets.symmetric(horizontal: 16);
|
static EdgeInsetsGeometry paddingIOS(BuildContext context, ResponsiveUtils responsiveUtils) {
|
||||||
|
if (responsiveUtils.isLandscapeMobile(context)) {
|
||||||
|
return EdgeInsets.zero;
|
||||||
|
} else if (responsiveUtils.isPortraitTablet(context) || responsiveUtils.isLandscapeTablet(context)) {
|
||||||
|
return const EdgeInsetsDirectional.only(top: 40, start: 16, end: 16, bottom: 4);
|
||||||
|
} else {
|
||||||
|
return const EdgeInsetsDirectional.only(top: 60, start: 16, end: 16, bottom: 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static const EdgeInsetsGeometry padding = EdgeInsetsDirectional.symmetric(horizontal: 16);
|
||||||
static const EdgeInsetsGeometry buttonPadding = EdgeInsets.all(5);
|
static const EdgeInsetsGeometry buttonPadding = EdgeInsets.all(5);
|
||||||
}
|
}
|
||||||
@@ -42,8 +42,12 @@ class EmailViewAppBarWidget extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return LayoutBuilder(builder: (context, constraints) {
|
return LayoutBuilder(builder: (context, constraints) {
|
||||||
return Container(
|
return Container(
|
||||||
height: EmailViewAppBarWidgetStyles.height,
|
height: PlatformInfo.isIOS
|
||||||
padding: EmailViewAppBarWidgetStyles.padding,
|
? EmailViewAppBarWidgetStyles.heightIOS(context, _responsiveUtils)
|
||||||
|
: EmailViewAppBarWidgetStyles.height,
|
||||||
|
padding: PlatformInfo.isIOS
|
||||||
|
? EmailViewAppBarWidgetStyles.paddingIOS(context, _responsiveUtils)
|
||||||
|
: EmailViewAppBarWidgetStyles.padding,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
|
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
|
||||||
child: _buildScaffoldHaveDrawer(body: ThreadView())),
|
child: _buildScaffoldHaveDrawer(body: ThreadView())),
|
||||||
|
const VerticalDivider(color: AppColor.lineItemListColor, width: 12),
|
||||||
Expanded(child: EmailView()),
|
Expanded(child: EmailView()),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@@ -62,6 +63,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
|
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
|
||||||
child: _buildScaffoldHaveDrawer(body: const SendingQueueView())),
|
child: _buildScaffoldHaveDrawer(body: const SendingQueueView())),
|
||||||
|
const VerticalDivider(color: AppColor.lineItemListColor, width: 12),
|
||||||
Expanded(child: EmailView()),
|
Expanded(child: EmailView()),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
|
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
|
||||||
child: ThreadView()),
|
child: ThreadView()),
|
||||||
|
const VerticalDivider(color: AppColor.lineItemListColor, width: 12),
|
||||||
Expanded(child: EmailView()),
|
Expanded(child: EmailView()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -196,6 +197,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
|
width: ResponsiveUtils.defaultSizeLeftMenuMobile,
|
||||||
child: ThreadView()),
|
child: ThreadView()),
|
||||||
|
const VerticalDivider(color: AppColor.lineItemListColor, width: 12),
|
||||||
Expanded(child: EmailView()),
|
Expanded(child: EmailView()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user