handlePushRoute method

  1. @protected
  2. @mustCallSuper
  3. @visibleForTesting
Future<void> handlePushRoute(
  1. String route
)

Called when the host tells the app to push a new route onto the navigator.

This notifies the binding observers (using WidgetsBindingObserver.didPushRoute), in registration order, until one returns true, meaning that it was able to handle the request (e.g. by opening a dialog box). If none return true, then nothing happens.

This method exposes the pushRoute notification from SystemChannels.navigation.

Implementation

@protected
@mustCallSuper
@visibleForTesting
Future<void> handlePushRoute(String route) async {
  final RouteInformation routeInformation = RouteInformation(uri: Uri.parse(route));
  for (final WidgetsBindingObserver observer in List<WidgetsBindingObserver>.of(_observers)) {
    if (await observer.didPushRouteInformation(routeInformation)) {
      return;
    }
  }
}