From 92741bd22e866b1cef307d8b3e7443174fd33c6f Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Fri, 6 Oct 2023 09:36:24 +0700 Subject: [PATCH] TW-765: Keep navigation bar when open search page --- .../layouts/adaptive_layout/adaptive_scaffold.dart | 3 +-- .../layouts/adaptive_layout/adaptive_scaffold_view.dart | 9 ++------- lib/widgets/layouts/enum/adaptive_destinations_enum.dart | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart index 488ae01802..f438ee569f 100644 --- a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart @@ -70,8 +70,7 @@ class AdaptiveScaffoldAppController extends State { } void _onOpenSearchPage() { - activeNavigationBar.value = AdaptiveDestinationEnum.search; - _jumpToPageByIndex(); + pageController.jumpToPage(AdaptiveDestinationEnum.search.index); } void _onCloseSearchPage() { diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart index 5fc9ccf556..235f5347f8 100644 --- a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_view.dart @@ -63,8 +63,6 @@ class AppScaffoldView extends StatelessWidget { valueListenable: activeNavigationBar, builder: (_, navigatorBar, child) { switch (navigatorBar) { - case AdaptiveDestinationEnum.search: - return const SizedBox(); case AdaptiveDestinationEnum.contacts: case AdaptiveDestinationEnum.rooms: default: @@ -107,11 +105,8 @@ class AppScaffoldView extends StatelessWidget { _bottomNavigationBarBuilder(context), ), ), - _triggerPageViewBuilder( - navigatorBarType: AdaptiveDestinationEnum.search, - navigatorBarWidget: Search( - onCloseSearchPage: onCloseSearchPage, - ), + Search( + onCloseSearchPage: onCloseSearchPage, ), ], ), diff --git a/lib/widgets/layouts/enum/adaptive_destinations_enum.dart b/lib/widgets/layouts/enum/adaptive_destinations_enum.dart index 2cb62815f0..ef4801da26 100644 --- a/lib/widgets/layouts/enum/adaptive_destinations_enum.dart +++ b/lib/widgets/layouts/enum/adaptive_destinations_enum.dart @@ -19,6 +19,7 @@ enum AdaptiveDestinationEnum { ), label: L10n.of(context)!.contacts, ); + case AdaptiveDestinationEnum.search: case AdaptiveDestinationEnum.rooms: return NavigationDestination( icon: UnreadRoomsBadge(