Skip to content
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

How to set navigator key with qlevar_router #1

Closed
jimmyhappy19920308 opened this issue Aug 10, 2022 · 1 comment
Closed

How to set navigator key with qlevar_router #1

jimmyhappy19920308 opened this issue Aug 10, 2022 · 1 comment

Comments

@jimmyhappy19920308
Copy link

jimmyhappy19920308 commented Aug 10, 2022

Hi @SchabanBo :)
When use qlevar_router need to change MaterialApp to MaterialApp.router() then no navigator propterty to set.
How can i no need pass context anytime?

@SchabanBo
Copy link
Owner

Hi @yingming25, you can make this,

    final router = QRouterDelegate(routes);
    Overlayment.navigationKey = router.key;

    return MaterialApp.router(
      routeInformationParser: const QRouteInformationParser(),
      routerDelegate: router,
    );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants