navigate static method

void navigate(
  1. BuildContext context,
  2. String page
)

Implementation

static void navigate(BuildContext context, String page) {
  Navigator.of(context).popUntil((predicate) => predicate.isFirst);
  Navigator.of(context).pushReplacementNamed(page);
}