This is the build function of MyApp:
return MaterialApp.router(
routerDelegate: MainRouterDelegate(),
routeInformationParser: MainRouteInformationParser(),
);
This is the build function of MainRouterDelegate:
@override
Widget build(BuildContext context) {
return Navigator(
key: navigatorKey,
observers: [
FirebaseAnalyticsObserver(analytics: analytics),
],
pages: [
MaterialPage(child: getFirstScreen(isMentor, userId, meetingId, isSchedule, action)),
],
onPopPage: (route, result) {
if (!route.didPop(result)) return false;
show404 = false;
notifyListeners();
return true;
},
);
}
- I want to ignore the back button (android device and browser).
- When exactly is 'onPopPage' called?