pushReplacement static method

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

Replaces the current page with a new page.

This is equivalent to calling NavPages.of(context).pushReplacement(page). Clears the navigation stack and sets the new page as the only page.

Example:

NavPages.pushReplacement(context, LoginPage());

Implementation

static void pushReplacement(BuildContext context, Widget page) {
  of(context).pushReplacement(page);
}