makeFirst static method

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

Implementation

static void makeFirst(BuildContext context, Widget page) {
  Navigator.of(context).popUntil((predicate) => predicate.isFirst);
  Navigator.of(context).pushReplacement(
    new MaterialPageRoute(builder: (context) => page),
  );
}