toReplacement method

List<PageSettings> toReplacement(
  1. String routeName
)

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;
}