handlePushRoute method

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

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
Future<void> handlePushRoute(String route) async {
  for (WidgetsBindingObserver observer in List<WidgetsBindingObserver>.from(_observers)) {
    if (await observer.didPushRoute(route))
      return;
  }
}