This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
handle alt+rightArrow or alt+leftArrow keys to navigate back and forth in the current history stack #267
Labels
enhancement
New feature or request
Discussed in #212
Originally posted by Agondev November 25, 2021
By wrapping the MaterialApp's builder's child with CallbackShortcut and passing various options of popping route, like
Navigator.of(context)
or
context.pop()
or
GoRouterDelegate
or
_goRouter.pop()
or
Router.of(context).routerDelegate.popRoute()
etc.
I get exceptions like
Router operation requested with a context that does not include a Router.
and
No GoRouter found in context
.Only thing that seems to kind of work is appRouter.navigator?.pop(), and that requires 2 attempts after the first time. With Auto Route it's enough to call
_autoRoute.pop()
from anywhere in the app using a shortcut of my choosing for it to pop the closest encompassing route.Can the same not be done in GoRouter?
Example of my latest draft of MaterialApp
To reiterate, the first binding works in GoRouter after two attempts, the second one just throws. But it does work in Auto Route with no problems.
The text was updated successfully, but these errors were encountered: