replaceNamed method

void replaceNamed(
  1. String name, {
  2. Map<String, String> params = const <String, String>{},
  3. Map<String, dynamic> queryParams = const <String, dynamic>{},
  4. Object? extra,
})

Replaces the top-most page of the page stack with the named route w/ optional parameters, e.g. name='person', params={'fid': 'f2', 'pid': 'p1'}.

See also:

  • goNamed which navigates a named route.
  • pushNamed which pushes a named route onto the page stack.

Implementation

void replaceNamed(
  String name, {
  Map<String, String> params = const <String, String>{},
  Map<String, dynamic> queryParams = const <String, dynamic>{},
  Object? extra,
}) {
  replace(
    namedLocation(name, params: params, queryParams: queryParams),
    extra: extra,
  );
}