pushReplacement method

  1. @Deprecated('Use vRouter.to(..., isReplacement: true) instead')
void pushReplacement(
  1. String newUrl, {
  2. Map<String, String> queryParameters = const {},
  3. Map<String, String> historyState = const {},
})

Replace the current one by the new route corresponding to the given url The difference with push is that this overwrites the current browser history entry If you are on mobile, this is the same as push Path can be of one of two forms:

  • stating with '/', in which case we just navigate to the given path
  • not starting with '/', in which case we append the current path to the given one

We can also specify queryParameters, either by directly putting them is the url or by providing a Map using queryParameters

We can also put a state to the next route, this state will be a router state (this is the only kind of state that we can push) accessible with VRouter.of(context).historyState

Implementation

@Deprecated('Use vRouter.to(..., isReplacement: true) instead')
void pushReplacement(
  String newUrl, {
  Map<String, String> queryParameters = const {},
  Map<String, String> historyState = const {},
}) =>
    to(
      newUrl,
      queryParameters: queryParameters,
      historyState: historyState,
      isReplacement: true,
    );