What is the best approach to handle routing with GoRoute and ShellRoute.
I have 3 screens. Setting - show full screen A - show with a Bottom Navigation (wrapped with Shelled Route) B - show with a Bottom Navigation (wrapped with Shelled Route)
The only issue I encounter in this config is a missing back button when I go to Settings screen. How can I fix it?
final goRouter = GoRouter(
initialLocation: '/a',
navigatorKey: _rootNavigatorKey,
routes: [
GoRoute( // = Do not show Bottom Navigation, just a full screen
path: '/settings',
pageBuilder: (context, state) => const NoTransitionPage(
child: SettingsPage(),
),
),
ShellRoute( // ShellRoute = Show Bottom Navigation
navigatorKey: _shellNavigatorKey,
builder: (context, state, child) {
return ScaffoldWithBottomNavigation(
tabs: tabs,
child: child,
);
},
routes: [
GoRoute(
path: '/a',
pageBuilder: (context, state) => const NoTransitionPage(
child: HomeScreen(label: 'A', detailsPath: '/a/details'),
),
routes: [
GoRoute(
path: 'details',
builder: (context, state) => const DetailsScreen(label: 'A'),
),
],
),
GoRoute(
path: '/b',
pageBuilder: (context, state) => const NoTransitionPage(
child: HomeScreen(label: 'B', detailsPath: '/b/details'),
),
routes: [
GoRoute(
path: 'details',
builder: (context, state) => const DetailsScreen(label: 'B'),
),
],
),
],
),
],
);