toAndRemoveUntil<T extends Object?> method

Future<T?> toAndRemoveUntil<T extends Object?>(
  1. String newRouteName, {
  2. String? untilRouteName,
  3. Object? arguments,
  4. Map<String, String>? queryParams,
  5. bool fullscreenDialog = false,
  6. bool maintainState = true,
})

Find the page with given routeName and then remove all the previous routes until meeting the route with defined route name untilRouteName. If no route name is given (untilRouteName is null) , all routes will be removed except the new page route.

It is similar to _navigate.toNamedAndRemoveUntil method.

Implementation

Future<T?> toAndRemoveUntil<T extends Object?>(
  String newRouteName, {
  String? untilRouteName,
  Object? arguments,
  Map<String, String>? queryParams,
  bool fullscreenDialog = false,
  bool maintainState = true,
}) {
  return _navigationBuilder.toAndRemoveUntil<T>(
    newRouteName,
    untilRouteName: untilRouteName,
    arguments: arguments,
    queryParams: queryParams,
    fullscreenDialog: fullscreenDialog,
    maintainState: maintainState,
  );
}