subscribe method
Subscribe routeAware
to be informed about changes to route
.
Going forward, routeAware
will be informed about qualifying changes
to route
, e.g. when route
is covered by another route or when route
is popped off the Navigator stack.
Implementation
void subscribe(TransitionRouteAware routeAware, R route) {
assert(route != null);
final subscribers =
_listeners.putIfAbsent(route, () => <TransitionRouteAware>{});
if (subscribers.add(routeAware)) {
routeAware.didPush();
Future.delayed(route!.transitionDuration, () {
routeAware.didPushAfterTransition();
});
}
}