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(MyRouteAware routeAware, R route) {
final Set<MyRouteAware> subscribers =
_listeners.putIfAbsent(route, () => <MyRouteAware>{});
if (subscribers.add(routeAware)) {
routeAware.didPush();
}
}