Future pushReplacementNamed(BuildContext context, String routeName, { result })

Replace the current route by pushing the route named routeName and then disposing the previous route.

The route name will be passed to the navigator's onGenerateRoute callback. The returned route will be pushed into the navigator.

Returns a Future that completes to the result value passed to pop when the pushed route is popped off the navigator.

Typical usage is as follows:

Navigator.of(context).pushReplacementNamed('/jouett/1781');

Source

static Future<dynamic> pushReplacementNamed(BuildContext context, String routeName, { dynamic result }) {
  return Navigator.of(context).pushReplacementNamed(routeName, result: result);
}