From b0d749c18845f8eb5d00840d390bc57382dc1d56 Mon Sep 17 00:00:00 2001 From: dab246 Date: Tue, 11 Oct 2022 09:31:05 +0700 Subject: [PATCH] TF-983 Move mailbox search up --- .../mailbox/presentation/mailbox_view.dart | 6 ++-- .../presentation/mailbox_view_web.dart | 34 +++++++------------ 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/lib/features/mailbox/presentation/mailbox_view.dart b/lib/features/mailbox/presentation/mailbox_view.dart index f034b4951..9ae8f5e97 100644 --- a/lib/features/mailbox/presentation/mailbox_view.dart +++ b/lib/features/mailbox/presentation/mailbox_view.dart @@ -214,14 +214,12 @@ class MailboxView extends GetWidget { padding: EdgeInsets.only(bottom: controller.isSelectionEnabled() ? 16 : 0), child: Column(children: [ Obx(() { - if ((controller.isSelectionEnabled() && _responsiveUtils.isLandscapeMobile(context)) - || (BuildUtils.isWeb && _responsiveUtils.isDesktop(context))) { + if (controller.isSelectionEnabled() && _responsiveUtils.isLandscapeMobile(context)) { return const SizedBox.shrink(); } return _buildUserInformation(context); }), - if ((BuildUtils.isWeb && !_responsiveUtils.isDesktop(context)) - || !BuildUtils.isWeb) _buildSearchBarWidget(context), + _buildSearchBarWidget(context), _buildLoadingView(), Obx(() => controller.defaultMailboxTree.value.root.childrenItems?.isNotEmpty ?? false ? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultMailboxTree.value.root) diff --git a/lib/features/mailbox/presentation/mailbox_view_web.dart b/lib/features/mailbox/presentation/mailbox_view_web.dart index 63a222498..b03321ff7 100644 --- a/lib/features/mailbox/presentation/mailbox_view_web.dart +++ b/lib/features/mailbox/presentation/mailbox_view_web.dart @@ -163,20 +163,9 @@ class MailboxView extends GetWidget with AppLoaderMixin, Popu ? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultRootNode) : const SizedBox.shrink()), const SizedBox(height: 8), - Obx(() { - if (controller.folderMailboxHasChild) { - return Column(children: const [ - Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2), - SizedBox(height: 8), - ]); - } - return const SizedBox.shrink(); - }), - Obx(() => controller.folderMailboxHasChild - ? _buildMailboxCategory(context, MailboxCategories.folders, controller.folderRootNode) - : const SizedBox.shrink()), - const SizedBox(height: 8), const Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2), + const SizedBox(height: 8), + _buildHeaderMailboxCategory(context, MailboxCategories.folders), Row(children: [ Expanded(child: _buildSearchBarWidget(context)), Padding( @@ -189,6 +178,9 @@ class MailboxView extends GetWidget with AppLoaderMixin, Popu tooltip: AppLocalizations.of(context).new_mailbox, onTap: () => controller.goToCreateNewMailboxView())), ]), + Obx(() => controller.folderMailboxHasChild + ? _buildMailboxCategory(context, MailboxCategories.folders, controller.folderRootNode) + : const SizedBox.shrink()), ]) ); } @@ -211,7 +203,8 @@ class MailboxView extends GetWidget with AppLoaderMixin, Popu Widget _buildHeaderMailboxCategory(BuildContext context, MailboxCategories categories) { return Padding( - padding: EdgeInsets.only(top: 10, bottom: 10, + padding: EdgeInsets.only( + top: 10, left: _responsiveUtils.isDesktop(context) ? 0 : 16, right: _responsiveUtils.isDesktop(context) ? 0 : 16), child: Row(children: [ @@ -257,14 +250,11 @@ class MailboxView extends GetWidget with AppLoaderMixin, Popu if (categories == MailboxCategories.exchange) { return _buildBodyMailboxCategory(context, categories, mailboxNode); } - return Column(children: [ - _buildHeaderMailboxCategory(context, categories), - AnimatedContainer( - duration: const Duration(milliseconds: 400), - child: categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND - ? _buildBodyMailboxCategory(context, categories, mailboxNode) - : const Offstage()) - ]); + return AnimatedContainer( + duration: const Duration(milliseconds: 400), + child: categories.getExpandMode(controller.mailboxCategoriesExpandMode.value) == ExpandMode.EXPAND + ? _buildBodyMailboxCategory(context, categories, mailboxNode) + : const Offstage()); } List _buildListChildTileWidget(BuildContext context,