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

Suspected conflict with flow_builder #23

Closed flodaniel closed 1 year ago

flodaniel commented 1 year ago

We are using the flow_builder package which also uses the SystemChannels.navigation.setMethodCallHandler();. In addition we use the loader_overlay package, which uses this package.

As soon as a BackButtonInterceptor is added, the flow_builder package stops to register android back button navigations.

This is how flow_builder works with the SystemChannels.navigation:

image

The flow builder calls that class in initState

image

Based on documentation of SystemChannels.navigation.setMethodCallHandler, the one replaces the other:

image
marcglasberg commented 1 year ago

Yes, it seems it's using the same mechanism and conflicting. Sorry, but I don't intend on fixing this, as I don't use the flow_builder package. But feel free to PR a solution, if you know how to fix it. As long as it doesn't interfere with the way the interceptor works when the flow_builder is not being used.

flodaniel commented 1 year ago

@marcglasberg understandable. I hope that we can move flow_builder to your package, which should resolve the issue.

https://github.com/felangel/flow_builder/issues/102