slovnicki / beamer

A routing package built on top of Router and Navigator's pages API, supporting arbitrary nested navigation, guards and more.
MIT License
582 stars 128 forks source link

`BeamPage.popToNamed` should evaluate `BeamPage.onPopPage()` first #619

Open giorgiogross opened 1 year ago

giorgiogross commented 1 year ago

Is your feature request related to a problem? Please describe. Hey! I have the following set up:

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.