Open matuella opened 2 years ago
Hey @matuella
That's a very good suggestion!
There's a third option too; we can treat this with a similar callback as onPopPage
.
I'd like to conditionally stop navigation altogether - not just beamBack
. Imagine you're on a form, fields have been modified, and you have a drawer which allows navigation elsewhere in the app. If I tap an item in the drawer, I want to check if the form is modified and prompt the user prior to continuing navigation. This seems to be an overlooked feature in Navigator 2.0 in general. It seems like you have to roll your own solution.
Is your feature request related to a problem? Please describe. Currently, if I use
BeamerBackButtonDispatcher
withalwaysBeamBack
, I have no way to intercept (and possibly block/veto) navigations that comes from.beamBack
.Describe the solution you'd like We could have a widget that does similar to
WillPopScope
but that also handles beam backs, i.e:BeamerWillPopScope
, or even a completely independent widget that only observers beam backs, i.e.WillBeamBackScope
.