didPop method

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

Called when a route has been popped off the navigator.

route is the route that is being popped off the navigator. previousRoute is the route that is now on top after the pop.

Implementation

@override
void didPop(Route<dynamic> route, Route<dynamic>? previousRoute) {
  super.didPop(route, previousRoute);
  // Update the topRoute to the previous route that is now on top.
  topRoute = previousRoute;
}