setNewRoutePath method

  1. @override
Future<void> setNewRoutePath(
  1. FRouteMatch configuration
)
override

Called by the Router when the Router.routeInformationProvider reports that a new route has been pushed to the application by the operating system.

Consider using a SynchronousFuture if the result can be computed synchronously, so that the Router does not need to wait for the next microtask to schedule a build.

Implementation

@override
Future<void> setNewRoutePath(FRouteMatch configuration) {
  if (configuration.matchedBy == this) {
    if (_currentActive != configuration) {
      final match = configuration.match;
      log.info("new route: ${match.resolvedUri}");
      // _checkLocationForTabChange(resolvedUri);
      state.pushRoute(match, isPage: true, replace: preferUpdates);
      rootState.pushHistoryItem(configuration);
      makeActive();
      _notifyIfReady();
    }
  } else {
    return configuration.matchedBy.setNewRoutePath(configuration);
  }
  return SynchronousFuture(null);
}