setNewRoutePath method

  1. @override
Future<void> setNewRoutePath(
  1. RouteState 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(RouteState configuration) async {
  l.log('setNewRoutePath = $configuration', name: debugLabel);
  // fix dublicate start page
  if (_init == false && initialRoute.isThisPage(configuration)) {
    _init = true;
    previousState.add(RouteState(
        uri: initialRoute.state(configuration.uri).uri,
        uriState: configuration.uriState));
    return;
  }
  pages?.clear();
  previousState.clear();

  updatePage(configuration,
      addOne: configuration.uri == initialRoute.state(null).uri);
}