pushAndRemoveUntil<T> method
Push to a given route and clear the existing navigation stack
Implementation
Future<T?> pushAndRemoveUntil<T>(Widget widget) {
return Navigator.of(this).pushAndRemoveUntil(
MaterialPageRoute<T>(builder: (BuildContext context) => widget),
(Route<dynamic> route) => false,
);
}