Open rignaneseleo opened 7 months ago
Removing android:enableOnBackInvokedCallback="true"
from my <application>
tag in AndroidManifest.xml
fixed the problem.
for me this didn't work i had to use back_button_interceptor
and then somewhere in root
from appRouter get the current context in interceptor context
bool _routeInterceptor(stopDefaultButtonEvent, info) {
var navigationState =
Navigator.of(widget.appRouter.navigatorKey.currentContext!);
if (navigationState.canPop()) {
navigationState.pop();
return true;
}
return false;
}
Hi, I'm on version
7.8.4
and I'm having a problem with navigation on Android 14: when I press the phone back button on any page of the app, it closes instead of executing the pop() function. TheonWillPop
functions are never triggered.I read #1391 and tried to manually set the backButtonDispatcher to
ChildBackButtonDispatcher( Router.of(context).backButtonDispatcher!)
but the app crashes with error "Router operation requested with a context that does not include a Router."This is my app.dart:
Here is my router.dart: