Skip to content

Commit

Permalink
TW-765: Keep navigation bar when open search page
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev authored and hoangdat committed Oct 6, 2023
1 parent 6bc46f4 commit 92741bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions lib/widgets/layouts/adaptive_layout/adaptive_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ class AdaptiveScaffoldAppController extends State<AdaptiveScaffoldApp> {
}

void _onOpenSearchPage() {
activeNavigationBar.value = AdaptiveDestinationEnum.search;
_jumpToPageByIndex();
pageController.jumpToPage(AdaptiveDestinationEnum.search.index);
}

void _onCloseSearchPage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -107,11 +105,8 @@ class AppScaffoldView extends StatelessWidget {
_bottomNavigationBarBuilder(context),
),
),
_triggerPageViewBuilder(
navigatorBarType: AdaptiveDestinationEnum.search,
navigatorBarWidget: Search(
onCloseSearchPage: onCloseSearchPage,
),
Search(
onCloseSearchPage: onCloseSearchPage,
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/widgets/layouts/enum/adaptive_destinations_enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum AdaptiveDestinationEnum {
),
label: L10n.of(context)!.contacts,
);
case AdaptiveDestinationEnum.search:
case AdaptiveDestinationEnum.rooms:
return NavigationDestination(
icon: UnreadRoomsBadge(
Expand Down

0 comments on commit 92741bd

Please sign in to comment.