setNewRoutePath method

  1. @override
Future<void> setNewRoutePath(
  1. ActivityRouteConfiguration 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(ActivityRouteConfiguration configuration) async {
  if (router._disposed) return;
  final revision = router._revision;
  if (!await router._allowExit(configuration._entries) ||
      router._disposed ||
      revision != router._revision) {
    return;
  }
  router._branches = configuration._branches;
  router._install(configuration._entries);
}