replace method

void replace(
  1. String path, {
  2. String? id,
})

Replace the current route by a new one by path.

id is used to match listeners.

Process route middlewares before replace.

Implementation

void replace(String path, {String? id}) {
  widget._state.replace(path, id: id);
}