popUntilNamed method

void popUntilNamed(
  1. String name
)

Removes routes from the top of the stack until reaches the route with the given name.

After this method, the route name will be at the top of the stack. An error will occur if this method is run when there is no route with the specified name on the stack.

Implementation

void popUntilNamed(String name) {
  while (currentRoute.name != name) {
    pop();
  }
}