From 7f5183414e5107928bb42d8be0958486a73463c8 Mon Sep 17 00:00:00 2001 From: problematicconsumer Date: Thu, 1 Feb 2024 12:25:47 +0330 Subject: [PATCH] Fix mobile routing behavior --- lib/core/router/routes.dart | 5 ----- .../common/adaptive_root_scaffold.dart | 22 +++++++++---------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/lib/core/router/routes.dart b/lib/core/router/routes.dart index 01a6feb6..ced9f8fc 100644 --- a/lib/core/router/routes.dart +++ b/lib/core/router/routes.dart @@ -269,7 +269,6 @@ class LogsOverviewRoute extends GoRouteData { Page buildPage(BuildContext context, GoRouterState state) { if (useMobileRouter) { return const MaterialPage( - fullscreenDialog: true, name: name, child: LogsOverviewPage(), ); @@ -288,7 +287,6 @@ class SettingsRoute extends GoRouteData { Page buildPage(BuildContext context, GoRouterState state) { if (useMobileRouter) { return const MaterialPage( - fullscreenDialog: true, name: name, child: SettingsOverviewPage(), ); @@ -307,7 +305,6 @@ class ConfigOptionsRoute extends GoRouteData { Page buildPage(BuildContext context, GoRouterState state) { if (useMobileRouter) { return const MaterialPage( - fullscreenDialog: true, name: name, child: ConfigOptionsPage(), ); @@ -346,7 +343,6 @@ class GeoAssetsRoute extends GoRouteData { Page buildPage(BuildContext context, GoRouterState state) { if (useMobileRouter) { return const MaterialPage( - fullscreenDialog: true, name: name, child: GeoAssetsOverviewPage(), ); @@ -369,7 +365,6 @@ class AboutRoute extends GoRouteData { Page buildPage(BuildContext context, GoRouterState state) { if (useMobileRouter) { return const MaterialPage( - fullscreenDialog: true, name: name, child: AboutPage(), ); diff --git a/lib/features/common/adaptive_root_scaffold.dart b/lib/features/common/adaptive_root_scaffold.dart index 91d15336..99c1d2bb 100644 --- a/lib/features/common/adaptive_root_scaffold.dart +++ b/lib/features/common/adaptive_root_scaffold.dart @@ -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,