didPush method

  1. @override
void didPush(
  1. Route route,
  2. Route? previousRoute
)
override

The Navigator pushed route.

The route immediately below that one, and thus the previously active route, is previousRoute.

Implementation

@override
void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
  super.didPush(route, previousRoute);
  if(route.settings == null || route.settings.name == null) {
    debugPrint("Pal Warning ------------------");
    debugPrint("You pushed a route without any name");
    debugPrint("If you want to use pal on this page please push a route with a settingsName ");
    debugPrint("or using pushNamed so we can recognize this page using this name as identifier");
    debugPrint("   Navigator.of(context).push(");
    debugPrint("       MaterialPageRoute(builder: (context) => MyPage(), settings: RouteSettings(name: '/myPageName'))");
    debugPrint("   );");
    debugPrint("------------------------------");
  }
  if (route is PageRoute) {
    _notify(route.settings);
    _notifyRoute(route);
  }
}