route method

void route(
  1. String location, [
  2. StandardPageNavigationMode? navigationMode,
  3. bool pushParentPage = true
])

Navigate to a page with the specified location. navigationMode represents the mode of StandardPageNavigationMode to use during navigation (optional). pushParentPage indicates whether to push the parent page when navigating to a child page. default is true.

Implementation

void route(
  String location, [
  StandardPageNavigationMode? navigationMode,
  bool pushParentPage = true,
]) async {
  assert(routerDelegate is StandardRouterDelegate);
  final tDelegate = routerDelegate as StandardRouterDelegate;
  final tConfiguration = await routeInformationParser?.parseRouteInformation(
    RouteInformation(uri: Uri.parse(location)),
  );

  if (tConfiguration != null) {
    tDelegate.routeWithConfiguration(
      tConfiguration,
      navigationMode,
      pushParentPage,
    );
  }
}