-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
After the last update go_router 9.0.0, you have removed the location parameter from GoRouter and cannot be accessed any more without a context.
final GoRouter router = GoRouter(
routes: [
GoRoute(
path: Routes.splashRoute,
builder: (BuildContext context, GoRouterState state) {
initSplashModule();
return const SplashScreen();
},
routes: [...],
],
),
// other routes
],
);
I cannot anymore use router.location to determine where am I in the application and there are certain scenarios where I cannot provide a context to GoRouterState.of(context).location, deep link or firebase messages that will pop or push some other routes from or to the navigation stack depending on the current location and state.
It was the easiest way to get the location and I can implement a way to do this on my own but it will take so much time and effort to get to the go_router package level.
Proposal
What was the reason to remove the location parameter and is there any chance that it will be back without a context in future versions?