pushAndRemoveUntil<T> method

Future<T?> pushAndRemoveUntil<T>(
  1. Widget page, {
  2. bool predicate(
    1. Route
    )?,
  3. Object? arguments,
  4. bool backGestureEnabled = true,
  5. bool maintainState = true,
  6. bool fullscreenDialog = false,
  7. Transition? transition,
  8. Duration? transitionDuration,
})

navigates to a new pages and remove until

transitionDuration is ignored when transition is equals to Transition.material or Transition.cupertino

backGestureEnabled not works on Android if transition is Transition.material

Implementation

Future<T?> pushAndRemoveUntil<T>(
  Widget page, {
  bool Function(Route<dynamic>)? predicate,
  Object? arguments,
  bool backGestureEnabled = true,
  bool maintainState = true,
  bool fullscreenDialog = false,
  Transition? transition,
  Duration? transitionDuration,
}) {
  return _navigator.pushAndRemoveUntil<T>(
    getRoute(
      page,
      arguments: arguments,
      maintainState: maintainState,
      fullscreenDialog: fullscreenDialog,
      transition: transition,
      transitionDuration: transitionDuration,
      backGestureEnabled: backGestureEnabled,
    ),
    predicate ?? (_) => false,
  );
}