You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a screen where I set an interceptor in initState like so: BackButtonInterceptor.add(_interceptor);
If I open a dialog [showDialog(...)], and press the "back" button,
I want the dialog to close and not fire the _interceptor method.
Currently the _interceptor is being called first,
and only after the second "back", the dialog will be closed.
Of course I can set a flag that indicates if a dialog is opened, and make sure to set it for all dialogs on open&close, but I feel like a default behavior should be closing dialogs first.
The text was updated successfully, but these errors were encountered:
The whole point of the back_button_interceptor is giving you a direct, fine grained control of the back button. It's difficult to take the current route into consideration, because sometimes that's not what you want to do. So, yes, you should probably add a flag.
However, I could try to add a mode where the interceptor only works if the route it was created on is the current route. At the moment I am not sure that's possible. I'll investigate it.
Could you please test version 4.3.0? Read the notes section in the README file. It's not published yet, you have to use this in your pubspec.yaml file:
I have a screen where I set an interceptor in
initState
like so:BackButtonInterceptor.add(_interceptor);
If I open a dialog [
showDialog(...)
], and press the "back" button,I want the dialog to close and not fire the
_interceptor
method.Currently the
_interceptor
is being called first,and only after the second "back", the dialog will be closed.
Of course I can set a flag that indicates if a dialog is opened, and make sure to set it for all dialogs on open&close, but I feel like a default behavior should be closing dialogs first.
The text was updated successfully, but these errors were encountered: