onPop method

  1. @mustCallSuper
  2. @override
void onPop(
  1. Route nextRoute
)
override

This method is called when the route is popped off the top of the RouterComponent's stack.

The argument for this method is the route that will become the next top-most route on the stack. Thus, the argument in onPop will always be the same as was given previously in onPush.

Implementation

@mustCallSuper
@override
void onPop(Route nextRoute) {
  final didRemove = game.overlays.remove(name);
  assert(didRemove, 'An overlay $name was already removed');
}