TF-3758 Update size for left menu on mobile

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-05-29 16:24:05 +07:00
committed by Dat H. Pham
parent 81f67353dc
commit 6949da4cce
3 changed files with 82 additions and 95 deletions
@@ -7,6 +7,7 @@ class ResponsiveUtils {
static const double defaultSizeLeftMenuMobile = 375;
static const double defaultSizeDrawer = 320;
static const double defaultSizeMenu = 256;
static const double mobileLeftMenuSize = 339;
static const int heightShortest = 600;
@@ -27,97 +27,87 @@ class MailboxView extends BaseMailboxView {
@override
Widget build(BuildContext context) {
ThemeUtils.setStatusBarTransparentColor();
return SafeArea(bottom: false, left: false, right: false,
top: controller.responsiveUtils.isMobile(context),
child: ClipRRect(
borderRadius: controller.responsiveUtils.isPortraitMobile(context)
? const BorderRadius.only(
topRight: Radius.circular(14),
topLeft: Radius.circular(14))
: const BorderRadius.all(Radius.zero),
child: Drawer(
child: Scaffold(
backgroundColor: Colors.white,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(children: [
_buildHeaderMailbox(context),
Expanded(child: Container(
color: Colors.white,
child: RefreshIndicator(
color: AppColor.primaryColor,
onRefresh: controller.refreshAllMailbox,
child: SafeArea(
top: false,
right: false,
bottom: false,
child: _buildListMailbox(context)
)
),
)),
Obx(() {
if (controller.isSelectionEnabled()
&& controller.listActionOfMailboxSelected.isNotEmpty) {
return SafeArea(
right: false,
top: false,
child: BottomBarSelectionMailboxWidget(
controller.listMailboxSelected,
controller.listActionOfMailboxSelected,
onMailboxActionsClick: (actions, listMailboxSelected) {
return controller.pressMailboxSelectionAction(
context,
actions,
listMailboxSelected
);
}
)
);
} else {
return const SizedBox.shrink();
}
}),
]),
),
Obx(() {
if (controller.isSelectionEnabled()) {
return const SizedBox.shrink();
}
return const Column(
mainAxisSize: MainAxisSize.min,
children: [
Divider(color: AppColor.colorDividerHorizontal),
QuotasView()
],
return SafeArea(
child: Drawer(
backgroundColor: Colors.white,
shape: InputBorder.none,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(children: [
_buildHeaderMailbox(context),
Expanded(child: Container(
color: Colors.white,
child: RefreshIndicator(
color: AppColor.primaryColor,
onRefresh: controller.refreshAllMailbox,
child: SafeArea(
top: false,
right: false,
bottom: false,
child: _buildListMailbox(context)
)
),
)),
Obx(() {
if (controller.isSelectionEnabled()
&& controller.listActionOfMailboxSelected.isNotEmpty) {
return SafeArea(
right: false,
top: false,
child: BottomBarSelectionMailboxWidget(
controller.listMailboxSelected,
controller.listActionOfMailboxSelected,
onMailboxActionsClick: (actions, listMailboxSelected) {
return controller.pressMailboxSelectionAction(
context,
actions,
listMailboxSelected
);
}),
Obx(() {
if (!controller.isSelectionEnabled() && controller.responsiveUtils.isPortraitMobile(context)) {
return Container(
width: double.infinity,
color: Colors.white,
padding: const EdgeInsets.all(16),
child: SafeArea(
top: false,
child: ApplicationVersionWidget(
padding: EdgeInsets.zero,
title: '${AppLocalizations.of(context).version} ',
),
),
);
} else {
return const SizedBox.shrink();
}
})
]),
)
)
)
}
)
);
} else {
return const SizedBox.shrink();
}
}),
]),
),
Obx(() {
if (controller.isSelectionEnabled()) {
return const SizedBox.shrink();
}
return const Column(
mainAxisSize: MainAxisSize.min,
children: [
Divider(color: AppColor.colorDividerHorizontal),
QuotasView()
],
);
}),
Obx(() {
if (!controller.isSelectionEnabled() && controller.responsiveUtils.isPortraitMobile(context)) {
return Container(
width: double.infinity,
color: Colors.white,
padding: const EdgeInsets.all(16),
child: SafeArea(
top: false,
child: ApplicationVersionWidget(
padding: EdgeInsets.zero,
title: '${AppLocalizations.of(context).version} ',
),
),
);
} else {
return const SizedBox.shrink();
}
}),
],
),
),
);
}
@@ -99,11 +99,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView {
drawer: ResponsiveWidget(
responsiveUtils: controller.responsiveUtils,
mobile: SizedBox(
width: double.infinity,
child: MailboxView()
),
landscapeMobile: SizedBox(
width: ResponsiveUtils.defaultSizeDrawer,
width: ResponsiveUtils.mobileLeftMenuSize,
child: MailboxView()
),
tablet: SizedBox(