From ca65aea69629dd8d46f67d309f266554e687f92c Mon Sep 17 00:00:00 2001 From: problematicconsumer Date: Tue, 14 Nov 2023 18:54:25 +0330 Subject: [PATCH] Fix bottom navigation bar accessibility --- .../common/adaptive_root_scaffold.dart | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/lib/features/common/adaptive_root_scaffold.dart b/lib/features/common/adaptive_root_scaffold.dart index 9b3936b5..5dea563b 100644 --- a/lib/features/common/adaptive_root_scaffold.dart +++ b/lib/features/common/adaptive_root_scaffold.dart @@ -148,23 +148,6 @@ class _CustomAdaptiveScaffold extends HookConsumerWidget { ), }, ), - bottomNavigation: useBottomSheet || - Breakpoints.smallMobile.isActive(context) - ? SlotLayout( - config: { - Breakpoints.small: SlotLayout.from( - key: const Key('bottomNavigation'), - builder: (_) => - AdaptiveScaffold.standardBottomNavigationBar( - currentIndex: selectedWithOffset(bottomDestinationRange), - destinations: destinationsSlice(bottomDestinationRange), - onDestinationSelected: (index) => - selectWithOffset(index, bottomDestinationRange), - ), - ), - }, - ) - : null, body: SlotLayout( config: { Breakpoints.standard: SlotLayout.from( @@ -176,6 +159,15 @@ class _CustomAdaptiveScaffold extends HookConsumerWidget { }, ), ), + // AdaptiveLayout bottom sheet has accessibility issues + bottomNavigationBar: useBottomSheet && Breakpoints.small.isActive(context) + ? NavigationBar( + selectedIndex: selectedWithOffset(bottomDestinationRange) ?? 0, + destinations: destinationsSlice(bottomDestinationRange), + onDestinationSelected: (index) => + selectWithOffset(index, bottomDestinationRange), + ) + : null, ); } }