onPush method

  1. @mustCallSuper
  2. @override
void onPush(
  1. Route? previousRoute
)
override

This method is invoked when the route is pushed on top of the RouterComponent's stack.

The argument for this method is the route that was on top of the stack before the push. It can be null if the current route becomes the first element of the navigation stack.

Implementation

@mustCallSuper
@override
void onPush(Route? previousRoute) {
  final didAdd = game.overlays.add(name);
  assert(didAdd, 'An overlay $name was already added before');
}