-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/packages
#2625Closed
Copy link
Labels
p: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
In order to update the navigation_and_routing sample, we need to place a ShellRoute within another ShellRoute. The route config should be something like this (I took out the builders out for brevity):
return MaterialApp.router(
routerConfig: GoRouter(
initialLocation: '/books/popular',
routes: [
ShellRoute(
routes: [
ShellRoute(
navigatorKey: booksNavigatorKey,
routes: [
GoRoute(
path: '/books/popular',
routes: [
GoRoute(
parentNavigatorKey: booksNavigatorKey,
path: 'book/:bookId',
),
],
),
GoRoute(
path: '/books/new',
routes: /* ... */
),
GoRoute(
path: '/books/all',
routes: /* ... */
),
],
),
GoRoute(
path: '/authors',
),
GoRoute(
path: '/settings',
),
],
),
GoRoute(
path: '/signin',
),
],
),
);But the ShellRoute constructor is asserting that it's children are instances of GoRoute, but conceptually it should be OK to place a ShellRoute within another, otherwise, there's no way to display a nested TabBar within a Scaffold with a BottomNavigationBar, for example:
parsa10 and tonyrbf96
Metadata
Metadata
Assignees
Labels
p: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
