didPushRouteInformation method

  1. @override
  2. @mustCallSuper
Future<bool> didPushRouteInformation(
  1. RouteInformation routeInformation
)
inherited

Called when the host tells the application to push a new RouteInformation and a restoration state onto the router.

The default implementation is to call the didPushRoute directly with the string constructed from RouteInformation.uri's path and query parameters.

Implementation

@override
@mustCallSuper
Future<bool> didPushRouteInformation(
    RouteInformation routeInformation) async {
  //
  final handled = super.didPushRouteInformation(routeInformation);
  // Loop through all the StateX objects
  final list = statesList(reversed: true, remove: this);
  for (final StateX state in list) {
    // final handled = await state.didPushRouteInformation(routeInformation);
    // if(handled){
    //   break;
    // }
    await state.didPushRouteInformation(routeInformation);
  }
  return handled;
}