cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
527 stars 625 forks source link

[Health 10.2.0] Incompatible with predictive back on Android 13/14 #966

Open ciriousjoker opened 1 month ago

ciriousjoker commented 1 month ago

Device / Emulator and OS

Please complete the following information for each phone and/or emulator you're experiencing this bug on:

Describe the bug

One requirement to use this plugin is to extend FlutterFragmentActivity instead of FlutterActivity. Is there anyway to remove the need to extend FlutterFragmentActivity?

This is a problem because it breaks predictive back:

FlutterActivity supports predictive back, but FlutterFragmentActivity currently doesn't. Related issues:

To Reproduce

  1. Run any flutter app with a navigator and a overview/detail screen model
  2. Add android:enableOnBackInvokedCallback="true" to the activity tag in AndroidManifest.xml
  3. Run the app, navigate to another screen
  4. Press the system back button (or do the gesture)

Expected behavior

App should stay open, user should be pushed back to the overview screen.

Actual behavior

App closes.

Screenshots

n/a

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.19.1, on macOS 14.5 23F79 darwin-arm64, locale de-DE) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.3) [✓] VS Code (version 1.89.1) [✓] Connected device (2 available) [✓] Network resources

• No issues found!

Additional information

Also happens in newer Flutter versions, ie 3.22.1 (newest at the time of writing).

ciriousjoker commented 1 month ago

Note this is probably something that should be fixed at the framework level, not in this plugin.