pushAndRemoveUntil<T> method

Future<T?> pushAndRemoveUntil<T>(
  1. Widget widget
)

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,
  );
}