Is your feature request related to a problem? Please describe.
Hey! I have the following set up:
I need to block navigation back / forward based on the app state. As onBeamBack is an open issue, I'm going with onPopPage.
onPopPage is, however, only triggered on pop() calls. Therefore, I'm only using pop() and never beamBack().
When I now open a modal, eg from /home to context.beamToNamed('/home/books/:publisherInfoUUID'), the default behaviour of the pop() would be to navigate to /home/books. But I want to pop back to where I came from, which is /home
So I set the modal's page popToNamed: '/home', but now the onPopPage() callback is not evaluated anymore, and the pop is always executed.
I'm aware that the latter point is rather me trying to make pop() behave like beamBack(), but as I cannot intercept beamBack() (if I'm not mistaken?) I'm forced to go this way.
Describe the solution you'd like
Evaluate onPopPage() even if popToNamed is set. I labeled this as a feature, as you seem to have intended the behaviour in beamer_delegate.dart L.1029
Describe alternatives you've considered
Maybe a cleaner solution would be to simply be able to intercept beamBack() ? Or to change/parameterize the default behaviour, so that /home -> /home/books/:publisherInfoUUID would pop back to /home instead of /home/books. In fact, from the definition of pop() (removes last page from the current locations page stack) and beamBack() (navigates to the last route), this would have been the behaviour I would have expected.
Is your feature request related to a problem? Please describe. Hey! I have the following set up:
onPopPage
.onPopPage
is, however, only triggered onpop()
calls. Therefore, I'm only usingpop()
and neverbeamBack()
./home
tocontext.beamToNamed('/home/books/:publisherInfoUUID')
, the default behaviour of thepop()
would be to navigate to/home/books
. But I want to pop back to where I came from, which is/home
popToNamed: '/home'
, but now theonPopPage()
callback is not evaluated anymore, and the pop is always executed.I'm aware that the latter point is rather me trying to make pop() behave like beamBack(), but as I cannot intercept beamBack() (if I'm not mistaken?) I'm forced to go this way.
Describe the solution you'd like Evaluate onPopPage() even if popToNamed is set. I labeled this as a feature, as you seem to have intended the behaviour in beamer_delegate.dart L.1029
Describe alternatives you've considered Maybe a cleaner solution would be to simply be able to intercept beamBack() ? Or to change/parameterize the default behaviour, so that
/home
->/home/books/:publisherInfoUUID
would pop back to/home
instead of/home/books
. In fact, from the definition ofpop()
(removes last page from the current locations page stack) andbeamBack()
(navigates to the last route), this would have been the behaviour I would have expected.