marcglasberg / back_button_interceptor

Flutter Package: May be used to intercept the Android back-button, as an alternative to `WillPopScope`.
BSD 2-Clause "Simplified" License
105 stars 21 forks source link

ifRouteChanged() not working with unnamed routes (Navigator 2.0) #14

Closed Lorenzohidalgo closed 2 years ago

Lorenzohidalgo commented 2 years ago

I was trying to use if (info.ifRouteChanged(context)) return false; to avoid running the interceptor while an alert dialog is being displayed and it's not working (Always returning false & opening a new AlertDialog). I'm using unnamed routes / Navigator 2.0.

Lorenzohidalgo commented 2 years ago

Solved, you need to specify useRootNavigator: false, in showDialog for it to be triggered. (showModalBottomSheet defaults to false)