toReplacement method
Add the page with the given routeName
and remove the last page.
Implementation
List<PageSettings> toReplacement(String routeName) {
if (isNotEmpty) {
removeLast();
}
add(PageSettings(name: routeName));
return this;
}