replace method

void replace(
  1. String location, {
  2. Object? extra,
})

Replaces the top-most page of the page stack with the given URL location w/ optional query parameters, e.g. /family/f2/person/p1?color=blue.

See also:

  • go which navigates to the location.
  • push which pushes the location onto the page stack.

Implementation

void replace(String location, {Object? extra}) {
  routeInformationParser
      .parseRouteInformation(
    DebugGoRouteInformation(location: location, state: extra),
  )
      .then<void>((RouteMatchList matchList) {
    routerDelegate.replace(matchList.matches.last);
  });
}