-
-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The app unfortunately closes on Android when using Predictive Back or the hardware back button #2059
Comments
having the same issue. |
Same issue here |
a valid workaround is to downgrade the Flutter-Sdk to 3.22.0 |
Current workaround is to pass custom onNavigationNotification in MaterialApp.router constructor. MaterialApp.router(
onNavigationNotification: _defaultOnNavigationNotification,
);
bool _defaultOnNavigationNotification(NavigationNotification _) {
switch (WidgetsBinding.instance.lifecycleState) {
case null:
case AppLifecycleState.detached:
case AppLifecycleState.inactive:
// Avoid updating the engine when the app isn't ready.
return true;
case AppLifecycleState.resumed:
case AppLifecycleState.hidden:
case AppLifecycleState.paused:
SystemNavigator.setFrameworkHandlesBack(true); /// This must be `true` instead of `notification.canHandlePop`, otherwise application closes on back gesture.
return true;
}
} |
Seems related to flutter/flutter#156517 |
With Flutter 3.24.3, all versions above 8.1.3 are defective for the back gesture in Android. |
Same issue here, only when using FlutterFragmentActivity |
Should I pass through something else? @TiesPol |
Any solution? |
This one seems to work: |
The app unfortunately closes on Android when using Predictive Back or the hardware back button
I have 5 tabs and I use AutoTabsScaffold to manage them. Whenever I tap on the second or other tab, the hardware back button takes me back to the first tab. But, after pressing the back button, the app exits. Need fix!
This issue started after I upgraded my Flutter version to 3.24
The text was updated successfully, but these errors were encountered: