Adds the given route to the navigator's history, and transitions to it.
The new route and the previous route (if any) are notified (see Route.didPush and Route.didChangeNext). If the Navigator has an Navigator.observer, it will be notified as well (see NavigatorObserver.didPush).
Ongoing gestures within the current route are canceled when a new route is pushed.
Returns a Future that completes when the pushed route is popped.
Source
Future<dynamic> push(Route<dynamic> route) { assert(!_debugLocked); assert(() { _debugLocked = true; return true; }); assert(route != null); assert(route._navigator == null); setState(() { Route<dynamic> oldRoute = _history.isNotEmpty ? _history.last : null; route._navigator = this; route.install(_currentOverlayEntry); _history.add(route); route.didPush(); route.didChangeNext(null); if (oldRoute != null) oldRoute.didChangeNext(route); config.observer?.didPush(route, oldRoute); }); assert(() { _debugLocked = false; return true; }); _cancelActivePointers(); return route.popped; }