felangel / flow_builder

Flutter Flows made easy! A Flutter package which simplifies navigation flows with a flexible, declarative API.
https://pub.dev/packages/flow_builder
MIT License
389 stars 63 forks source link

Consider using back_button_interceptor #102

Open flodaniel opened 1 year ago

flodaniel commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently flow_builder implementation has a conflict with packages that use the back_button_interceptor package, because both use the method SystemChannels.navigation.setMethodCallHandler to listen to navigation events. This causes the onGeneratePages callback to no longer being called on android back button navigation in certain scenarios.

Describe the solution you'd like A clear and concise description of what you want to happen. As the implementation of back_button_interceptor is lightweight and stable (nearly no open issues, version 6), I propose using it instead of relying on the own interceptor implementation. This resolves any conflicts and results in less code to maintain for flow_builder.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Sadly, I was unable to find a solution to merge to calls to the SystemChannels.navigation.setMethodCallHandler API. If that is somehow possible, this would also be a viable option.

Additional context Add any other context or screenshots about the feature request here. I discovered the bug when working with the loader_overlay package. Initially I filled a bug report there. After discovering the conflict, I filled a bug report with back_button_interceptor here. The maintainer confirmed the conflict, but declined to work on a possible solution, as they are not using flow_builder.

chillbrodev commented 10 months ago

@felangel We really need a fix for this as it is impacting usage of FlowBuiler on Flutter Web. We can see that the MethodCall of pushRouteInformation is being swallowed by the _handleSystemNavigation function. This prevents navigation from working when utilizing GoRouter

image
RootSoft commented 8 months ago

@felangel Having the exact same issue with using go_router and deep linking. As soon as I open a screen that uses flow_builder, deep linking stops works because flow_builder overrides the system navigation.

anqit commented 2 months ago

I'm not sure if this is the best issue to pile this on, but I would love to use this package (specifically wizard_router) for certain areas of an app while using go_router as the main navigation, but it has been difficult to get the two to play nicely with each other.