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
390 stars 64 forks source link

Physical back button close app from nested FlowBuilder (the first is to manage pages at same level) #12

Closed giandifra closed 3 years ago

giandifra commented 3 years ago

Describe the bug I'm trying to manage nested flow builders starting from a Drawer. If I press physical back button from nested page (NEWS DETAILS for example) the app closes.

                 ROOT PAGE (with drawer)
              /            |           \
             HOME         NEWS        SETTINGS
                           |
                        DETAILS
                           |
                        ANOTHER

The solution can be use IndexedStack for pages of root level, but I will want use FlowBuilder for experiment.

To Reproduce Steps to reproduce the behavior:

  1. Open the drawer
  2. Tap on "NEWS"
  3. Tap on FAB to go on next page
  4. Press physical back button

Expected behavior The navigator pop back to previous page.

Flutter Doctor ``` [✓] Flutter (Channel dev, 1.23.0-7.0.pre, on Mac OS X 10.15.6 19G2021 x86_64, locale it-IT) • Flutter version 1.23.0-7.0.pre at **/master • Framework revision db6e2d8aa5 (9 weeks ago), 2020-09-25 06:47:03 -0400 • Engine revision 3a73d073c8 • Dart version 2.11.0 (build 2.11.0-161.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /**/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 11.5) • Xcode at /Volumes/Samsung_X5/Applications/Xcode.app/Contents/Developer • Xcode 11.5, Build version 11E608c • CocoaPods version 1.8.4 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [!] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) [✓] IntelliJ IDEA Ultimate Edition (version 2020.2.3) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin installed • Dart plugin version 202.8070 [✓] VS Code (version 1.51.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.16.0 [✓] Connected device (4 available) • Pixel 2 XL (mobile) • 711KPWQ0617241 • android-arm64 • Android 11 (API 30) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.6 19G2021 x86_64 • Web Server (web) • web-server • web-javascript • Flutter Tools • Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.67 ! Doctor found issues in 1 category. ```

Additional context I have simplified the example to a minimum Here the code

felangel commented 3 years ago

Hi @giandifra 👋 Thanks for opening an issue!

I believe the underlying issue is https://github.com/flutter/flutter/issues/47088. I'll try to look into a fix for the underlying issue as soon as I can 👍

felangel commented 3 years ago

This has been fixed on Android in #14 (v0.0.1-dev.10) but still requires flutter/flutter#47088 to be fixed for iOS.

giandifra commented 3 years ago

I'm trying the example that i posted here (same posted above) but i still the same result:

  1. I navigate to NEWS with drawer and to next with FAB
  2. I press physical back button (Android)
  3. The app closes

The authentication flow example work fine (Android test)

felangel commented 3 years ago

ezgif com-gif-maker

@giandifra it seems to work for me 🤔

giandifra commented 3 years ago

This is pretty strange! What Flutter SDK are you using?

felangel commented 3 years ago

I’m using the latest stable (1.22.4)

giandifra commented 3 years ago

ezgif com-gif-maker

I was on Flutter master 1.23.0-7.0.pre I tried on Flutter stable 1.22.0 and 1.22.4 and I have same results. I tested on Pixel 2XL (Android 11)

felangel commented 3 years ago

@giandifra are you still able to reproduce this using the latest version of flow_builder?

giandifra commented 3 years ago

ezgif com-gif-maker

I was on Flutter master 1.23.0-7.0.pre I tried on Flutter stable 1.22.0 and 1.22.4 and I have same results. I tested on Pixel 2XL (Android 11)

I tested with same result.

Flutter Sdk: 1.26.0-8.0.pre Device: Pixel 2XL (Android 11) flow_builder: 0.0.1

felangel commented 3 years ago

@giandifra can you confirm whether or not the issue has been resolved in v0.0.2? Thanks!

giandifra commented 3 years ago

@giandifra can you confirm whether or not the issue has been resolved in v0.0.2? Thanks!

Yes it's working! Thanks