TF-682 Standardize layout of Mailbox Dashboard on web
This commit is contained in:
@@ -122,11 +122,11 @@ class EmailView extends GetWidget<EmailController> with NetworkConnectionMixin {
|
||||
}
|
||||
|
||||
Widget _buildBottomBar(BuildContext context) {
|
||||
bool isMobileDevice = responsiveUtils.isPortraitMobile(context) &&
|
||||
bool isMobileDevice = responsiveUtils.isPortraitMobile(context) ||
|
||||
responsiveUtils.isLandscapeMobile(context);
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: !BuildUtils.isWeb && isMobileDevice ? 16 : 0),
|
||||
bottom: isMobileDevice ? 16 : 0),
|
||||
child: Obx(() => (BottomBarMailWidgetBuilder(
|
||||
context,
|
||||
imagePaths,
|
||||
|
||||
@@ -51,9 +51,9 @@ class AppBarMailWidgetBuilder {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
if (_mailboxDashboardOnlyHasEmailView(_context))
|
||||
if (_responsiveUtils.mailboxDashboardHasMailboxAndEmailView(_context))
|
||||
_buildBackButton(),
|
||||
if (_mailboxDashboardOnlyHasEmailView(_context))
|
||||
if (_responsiveUtils.mailboxDashboardHasMailboxAndEmailView(_context))
|
||||
Expanded(child: _buildMailboxName()),
|
||||
if (_presentationEmail != null) _buildListOptionButton(),
|
||||
]
|
||||
@@ -62,16 +62,6 @@ class AppBarMailWidgetBuilder {
|
||||
);
|
||||
}
|
||||
|
||||
bool _mailboxDashboardOnlyHasEmailView(BuildContext context) {
|
||||
if (BuildUtils.isWeb) {
|
||||
return _responsiveUtils.isDesktop(context);
|
||||
} else {
|
||||
return _responsiveUtils.isPortraitMobile(context) ||
|
||||
_responsiveUtils.isLandscapeMobile(context) ||
|
||||
_responsiveUtils.isTablet(context);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildBackButton() {
|
||||
return buildIconWeb(
|
||||
icon: SvgPicture.asset(_imagePaths.icBack, width: 18, height: 18, color: AppColor.colorTextButton, fit: BoxFit.fill),
|
||||
|
||||
@@ -7,6 +7,8 @@ typedef OnPressEmailActionClick = void Function(EmailActionType emailActionType)
|
||||
|
||||
class BottomBarMailWidgetBuilder {
|
||||
|
||||
static const double maxWidthBottomBar = 540;
|
||||
|
||||
final BuildContext _context;
|
||||
final ImagePaths _imagePaths;
|
||||
final ResponsiveUtils _responsiveUtils;
|
||||
@@ -32,7 +34,9 @@ class BottomBarMailWidgetBuilder {
|
||||
color: Colors.white,
|
||||
child: MediaQuery(
|
||||
data: const MediaQueryData(padding: EdgeInsets.zero),
|
||||
child: _presentationEmail != null ? _buildListOptionButton(_presentationEmail!) : const SizedBox.shrink()
|
||||
child: _presentationEmail != null
|
||||
? _buildListOptionButton(_presentationEmail!)
|
||||
: const SizedBox.shrink()
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -91,7 +95,7 @@ class BottomBarMailWidgetBuilder {
|
||||
}})
|
||||
..text(AppLocalizations.of(_context).forward, isVertical: _responsiveUtils.isMobile(_context)))
|
||||
.build()),
|
||||
if (!_responsiveUtils.isDesktop(_context))
|
||||
if (_responsiveUtils.mailboxDashboardOnlyHasEmailView(_context))
|
||||
Expanded(child: (ButtonBuilder(_imagePaths.icNewMessage)
|
||||
..key(const Key('button_new_message'))
|
||||
..size(20)
|
||||
|
||||
Reference in New Issue
Block a user