didPushNext method

void didPushNext()

Called when a new route has been pushed on top of this route, temporarily obscuring it.

This method is called synchronously during the push operation, before the transition animation completes. The current route may still be partially visible as it animates out. To perform actions after the route is fully obscured, consider using ModalRoute.secondaryAnimation to listen for animation completion, for example:

link
ModalRoute.of(context)?.secondaryAnimation?.addStatusListener((AnimationStatus status) {
  if (status == AnimationStatus.completed) {
    // This route is now fully obscured by the new route.
  }
});

Implementation

void didPushNext() {}