I am trying to create the following navigation:
|_ShellRoute
|_GoRoute /a (needs bottomNav)
|_GoRoute /a/nested/:id (does not need bottomNav)
|_GoRoute /b (needs bottomNav)
|_GoRoute /c (needs bottomNav)
However when I navigate to /a/nested/1
the bottom navigation still shows.
My route code (I am using type safe routes, but I think this stills applies to "normal" go_router):
final rootNavigatorKey = GlobalKey<NavigatorState>();
final router = GoRouter(
routes: $appRoutes,
initialLocation: '/a',
navigatorKey: rootNavigatorKey,
);
final shellNavigatorKey = GlobalKey<NavigatorState>();
@TypedShellRoute<BottomShellRoute>(routes: [
TypedGoRoute<ARoute>(path: '/a', routes: [
TypedGoRoute<ANestedRoute>(path: 'nested/:id'),
]),
TypedGoRoute<BRoute>(path: '/b'),
TypedGoRoute<CRoute>(path: '/c'),
])
class BottomShellRoute extends ShellRouteData {
const BottomShellRoute();
static final GlobalKey<NavigatorState> $navigatorKey = shellNavigatorKey;
@override
Widget builder(BuildContext context, GoRouterState state, Widget navigator) => BottomShellScreen(
location: state.location,
child: navigator,
);
}
Any idea how to make this route not show the bottom navigation?