pushAndRemoveUntil<T> method
Navigate to a new screen and remove all previous screens from the stack.
Implementation
Future<T?> pushAndRemoveUntil<T>(Widget page,
{bool Function(Route<dynamic>)? predicate}) {
return Navigator.of(this).pushAndRemoveUntil(
MaterialPageRoute(builder: (_) => page),
predicate ?? (route) => false,
);
}