setNewRoutePath method

  1. @override
Future<void> setNewRoutePath(
  1. SplitRoutePath path, {
  2. bool ignoreLock = false,
})
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(
  SplitRoutePath path, {
  bool ignoreLock = false,
}) async {
  if (LockNavigatorService.instance.isLocked && !ignoreLock) {
    LockNavigatorService.instance.animate(showSnackbar: true);
  } else {
    routePath = path;

    routePath = pathTransformerCollection.transformAll(routePath);
  }
}