backUntil method

Future<void> backUntil(
  1. String fullRoute, {
  2. PopMode popMode = PopMode.Page,
})

Removes routes according to PopMode until it reaches the specifc fullRoute, DOES NOT remove the fullRoute

Implementation

Future<void> backUntil(
  String fullRoute, {
  PopMode popMode = PopMode.Page,
}) async {
  // remove history or page entries until you meet route
  var iterator = currentConfiguration;
  while (_canPop(popMode) &&
      iterator != null &&
      iterator.location != fullRoute) {
    await _pop(popMode);
    // replace iterator
    iterator = currentConfiguration;
  }
  refresh();
}