Closed Jasco07122021 closed 2 weeks ago
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 https://github.com/flutter/flutter/issues/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?
Any solution?
This one seems to work: https://github.com/Milad-Akarie/auto_route_library/issues/2059#issuecomment-2434908775
I have another problem with this... Now i have a endDrawer in my app like this:
return AutoTabsScaffold(
key: const Key('home_page_router_key'),
animationCurve: Curves.ease,
animationDuration: const Duration(milliseconds: 150),
lazyLoad: true,
primary: true,
homeIndex: 1,
routes: const [
NewsHomeRoute(),
FeedDiscoverHomeRoute(),
GamificationRankingRoute(),
ProfileRoute(),
],
endDrawer: FeroxLoggedProfileDrawer(),
endDrawerEnableOpenDragGesture: draggableEndDrawer,
...
But when i use Android back button this The drawer does not close until it reaches the initial route, regardless of whether it was opened on another route.
Why closed?
Any solution?
This one seems to work: #2059 (comment)
It's not a good practice to manage manually all states of lifecycle. It's work but not recommended at all. Take care when you will update your project or dependencies.
Any solution?
This one seems to work: #2059 (comment)
It's not a good practice to manage manually all states of lifecycle. It's work but not recommended at all. Take care when you will update your project or dependencies.
There's no management of states though, just an action performed on given lifecycle notifications (in this case to override the buggy "preferred" back button handling). While overriding the back button handling delegation may not be great, it's much better than having a buggy app navigation.
P.s. by all means, when the flutter team adds predictive back support for FlutterFragmentActivity, this workaround should be removed.
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