pushNamedAndRemoveUntil<T> method
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?> pushNamedAndRemoveUntil<T>(
String routeName, {
bool Function(Route<dynamic>)? predicate,
Object? arguments,
bool backGestureEnabled = true,
Transition? transition,
Duration? transitionDuration,
}) {
final route = _buildNamedRoute<T>(
routeName: routeName,
arguments: arguments,
backGestureEnabled: backGestureEnabled,
transition: transition,
transitionDuration: transitionDuration,
);
if (route == null) {
return _state!.pushNamedAndRemoveUntil<T>(
routeName,
predicate ?? (_) => false,
arguments: arguments,
);
}
return _state!.pushAndRemoveUntil<T>(
route,
predicate ?? (_) => false,
);
}