replace static method

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

Implementation

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