We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Error when calling the route using Modular.to.pushNamed
My code
Works well Navigator.pushNamed(context, '/datail/${homeController.text}');
Navigator.pushNamed(context, '/datail/${homeController.text}');
Does not work Modular.to.pushNamed('/datail/${homeController.text}');
Modular.to.pushNamed('/datail/${homeController.text}');
App Module
@override List<Router> get routers => [ Router('/', child: (_, args) => HomePage()), Router('/datail/:text', child: (_, args) => DatailPage( text: args.params['text'], )), ];
Error
Add Modular.navigatorKey in your MaterialApp; return MaterialApp( navigatorKey: Modular.navigatorKey, ... . 'package:flutter_modular/src/modular_base.dart': Failed assertion: line 94 pos 9: '_navigatorKey != null'
The text was updated successfully, but these errors were encountered:
Only navigationKey was missing 🤦🏽.
Add navigationKey in AppWidget
navigatorKey: Modular.navigatorKey,
Sorry, something went wrong.
No branches or pull requests
Error when calling the route using Modular.to.pushNamed
My code
Works well
Navigator.pushNamed(context, '/datail/${homeController.text}');
Does not work
Modular.to.pushNamed('/datail/${homeController.text}');
App Module
@override List<Router> get routers => [ Router('/', child: (_, args) => HomePage()), Router('/datail/:text', child: (_, args) => DatailPage( text: args.params['text'], )), ];
Error
Add Modular.navigatorKey in your MaterialApp;
return MaterialApp(
navigatorKey: Modular.navigatorKey,
...
.
'package:flutter_modular/src/modular_base.dart':
Failed assertion: line 94 pos 9: '_navigatorKey != null'
The text was updated successfully, but these errors were encountered: