New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use before having navigator in context #38
Comments
|
Hi @vasilich6107 , you can get the context from navigatorKey. /// Copy from: https://github.com/Milad-Akarie/auto_route_library/blob/e5ff8b91e1/auto_route/example/lib/mobile/main.dart
class _MyAppState extends State<MyApp> {
final authService = AuthService();
final navigatorKey = GlobalKey<NavigatorState>();
late final _rootRouter = RootRouter(
navigatorKey
// authGuard: AuthGuard(),
);
@override
Widget build(BuildContext context) {
return MaterialApp.router(
theme: ThemeData.dark(),
routerDelegate: _rootRouter.delegate(),
routeInformationProvider: _rootRouter.routeInfoProvider(),
routeInformationParser: _rootRouter.defaultRouteParser(),
builder: (_, router) {
return ChangeNotifierProvider<AuthService>(
create: (_) => authService,
child: BooksDBProvider(
child: router!,
),
);
},
);
}
} |
This could be a possible fix. |
#39 changed the meaning of 'persistent'. When the |
actually there is still a check at line 100 For now my code works, thanks for your help. |
I'm closing this issue for now |
Hi @sososdk. Thanks for your work.
I'm trying to use this lib to display
no connection
popupI need to place the Flash call before having navigator in context(i'm using auto_route lib)
I cannot use custom Overlay because Flash fails by trying to call to navigator
https://github.com/sososdk/flash/blob/master/lib/flash.dart#L94
The text was updated successfully, but these errors were encountered: