updateRouteInformation method

void updateRouteInformation(
  1. RouteInformation routeInformation
)

Pass this call to root which notifies the platform for a configuration change.

On Web, creates a new browser history entry and updates URL.

See SystemNavigator.routeInformationUpdated.

Implementation

void updateRouteInformation(RouteInformation routeInformation) {
  if (_parent == null) {
    if (!routeInformation.isEqualTo(_lastReportedRouteInformation)) {
      SystemNavigator.routeInformationUpdated(
        uri: routeInformation.uri,
        state: routeInformation.state,
      );
      _lastReportedRouteInformation = routeInformation.copyWith();
    }
  } else {
    if (updateParent) {
      _parent!.configuration = routeInformation.copyWith();
    }
    _parent!.updateRouteInformation(routeInformation);
  }
}