pushAndRemoveUntil static method

void pushAndRemoveUntil(
  1. BuildContext context,
  2. Widget page
)

clearPrevious pages

Implementation

static void pushAndRemoveUntil(BuildContext context, Widget page ) {
  var materialPageRoute = MaterialPageRoute(builder: (ctx) => page);
  Navigator.pushAndRemoveUntil(context, materialPageRoute, (e) => false);
}