Fix mobile routing behavior

This commit is contained in:
problematicconsumer
2024-02-01 12:25:47 +03:30
parent 36781c4856
commit 7f5183414e
2 changed files with 10 additions and 17 deletions

View File

@@ -106,18 +106,16 @@ class _CustomAdaptiveScaffold extends HookConsumerWidget {
return Scaffold(
key: RootScaffold.stateKey,
drawer: Breakpoints.small.isActive(context)
? SafeArea(
child: Drawer(
width: (MediaQuery.sizeOf(context).width * 0.88).clamp(0, 304),
child: NavigationRail(
extended: true,
selectedIndex: selectedWithOffset(drawerDestinationRange),
destinations: destinationsSlice(drawerDestinationRange)
.map((dest) => AdaptiveScaffold.toRailDestination(dest))
.toList(),
onDestinationSelected: (index) =>
selectWithOffset(index, drawerDestinationRange),
),
? Drawer(
width: (MediaQuery.sizeOf(context).width * 0.88).clamp(0, 304),
child: NavigationRail(
extended: true,
selectedIndex: selectedWithOffset(drawerDestinationRange),
destinations: destinationsSlice(drawerDestinationRange)
.map((dest) => AdaptiveScaffold.toRailDestination(dest))
.toList(),
onDestinationSelected: (index) =>
selectWithOffset(index, drawerDestinationRange),
),
)
: null,