popModeUntil method
Removes routes according to PopMode
until it reaches the specific fullRoute
,
DOES NOT remove the fullRoute
Implementation
@override
Future<void> popModeUntil(
String fullRoute, {
PopMode popMode = PopMode.history,
}) async {
// remove history or page entries until you meet route
RouteDecoder<T>? iterator = currentConfiguration;
while (_canPop(popMode) && iterator != null) {
//the next line causes wasm compile error if included in the while loop
//https://github.com/flutter/flutter/issues/140110
if (iterator.pageSettings?.name == fullRoute) {
break;
}
await _pop(popMode, null);
// replace iterator
iterator = currentConfiguration;
}
notifyListeners();
}