toAndRemoveUntil method
Add the page with the given routeName and remove all pages until the
page with untilRouteName name.
Implementation
List<PageSettings> toAndRemoveUntil(
String routeName,
String untilRouteName,
) {
while (true) {
if (last.name == untilRouteName) {
break;
}
if (isNotEmpty) {
removeLast();
} else {
break;
}
}
add(PageSettings(name: routeName));
return this;
}