-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/packages
#5497Closed
Copy link
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Use case
In ShellRoute example we have a /b/details as a route that we are pushing to the root stack.
I tried my best but I failed to create a working solution to push shell route instead of /b/details.
Lets imagine the we are replacing
GoRoute(
path: 'details',
parentNavigatorKey: _rootNavigatorKey,
builder: (BuildContext context, GoRouterState state) {
return const DetailsScreen(label: 'B');
},
),with
ShellRoute(
builder: (_, __, child) {
// fancy container with red border for demo purposes
return Container(child: child);
},
routes: [
GoRoute(
path: 'details',
// parentNavigatorKey: _rootNavigatorKey,
builder: (BuildContext context, GoRouterState state) {
return const DetailsScreen(label: 'B');
},
),
],
)In this case parentNavigatorKey: _rootNavigatorKey fails with error
Failed assertion: line 431 pos 16: 'route.parentNavigatorKey == null || route.parentNavigatorKey == navigatorKey': is not true.
If i comment out the parentNavigatorKey: _rootNavigatorKey, I'm unable to push this ShellRoute block into _rootNavigatorKey.
Proposal
Please implement the ability to push arbitrary ShellRoute into root stack in the same way as GoRoute can target any stack it would be great to give the same parentNavigatorKey option to ShellRoute
mikuhl-dev, furaiev, yaro-melnychuk, Coloud1, prossion and 12 moremikuhl-dev, furaiev, yaro-melnychuk, Coloud1, prossion and 1 more
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version