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

iOS Swipe back not working #76

Open flodaniel opened 2 years ago

flodaniel commented 2 years ago

Describe the bug When using the following pages, where the user starts on the overview page, and then navigates to the searchOnMap page, using the ios swipe back feature, does not correctly return back to the overview page, but to the original route that brought the application to the FlowBuilder, which is using this list of pages.

  List<Page> onGenerateEnterAddressPages(
      EnterAddressNavigationState state, List<Page<dynamic>> pages) {
    return [
      if (state.page == EnterAddressNavigationStatePage.overview)
        CustomPage.createWithoutAnalytics(EnterAddressView(isOnboarding)),
      if (state.page == EnterAddressNavigationStatePage.searchOnMap)
        CustomPage.createWithoutAnalytics(const SearchAddressOnMapPage())
    ];
  }

To Reproduce Steps to reproduce the behavior:

  1. Use a similar Parent->Child FlowBuilder navigation stack.
  2. Navigate from Parent to Child
  3. Try to swipe back from Child to Parent
  4. See that the page that is swipped back to is not the Parent, but the Page that brought you to the page (most likely with a classical navigation)
  5. See error

Expected behavior FlowBuilder correctly overrides navigation stack to make iOS swipe back feature work.

Logs Paste the output of running flutter doctor -v here.

[✓] Flutter (Channel stable, 2.5.2, on macOS 11.5.2 20G95 darwin-x64, locale en-GB) • Flutter version 2.5.2 at /Users/floriandaniel/Documents/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 3595343e20 (8 weeks ago), 2021-09-30 12:58:18 -0700 • Engine revision 6ac856380f • Dart version 2.14.3

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/floriandaniel/Library/Android/sdk • Platform android-31, build-tools 30.0.3 • ANDROID_HOME = /Users/floriandaniel/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165) ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 13.1, Build version 13A1030d • CocoaPods version 1.11.2

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.2) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.62.3) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.10.2

[✓] Connected device (2 available) • iPhone 13 mini (mobile) • 1EFEF66C-C941-4FE4-916E-7A459BCBC768 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator) • Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.55

! Doctor found issues in 1 category.

Gene-Dana commented 2 years ago

Hi there 👋🏼 May you please provide a repo so we can better help debug this?

flodaniel commented 2 years ago

Hi, sorry for my late reply. It seems to be in relation to the package https://pub.dev/packages/material_floating_search_bar. I recreated my problem and used the flow_builder example as a template: https://github.com/flodaniel/flow_builder_searchbar_bug

If you navigate to the location flow, and try to swipe back on iOS you will see that it is not working. The back button is working. Removing the FloatingSearchBar on line 43 fixes the issue.

I am unsure now if this is maybe an issue with the material_floating_search_bar package, but I don't think so.

Edit: I am currently having trouble reproducing the issue in the linked repo after fixing an unrelated layout bug. I will report back once I can, or find the issue. Thanks!

flodaniel commented 2 years ago

I updated the repository, which is now reproducing the bug when trying to swipe back from the State screen to the Country bug. After further investigation I am completely confused why it is not working, but I suspect a specific implementation by the FloatingSearchBar.