pushReplacementNamed<T extends Object, TO extends Object> method

  1. @optionalTypeArgs
Future<T> pushReplacementNamed <T extends Object, TO extends Object>(BuildContext context, String routeName, { TO result })

Replace the current route of the navigator that most tightly encloses the given context by pushing the route named routeName and then disposing the previous route once the new route has finished animating in.

Sample code

Typical usage is as follows:

void _showNext() {
  Navigator.pushReplacementNamed(context, '/jouett/1781');
}

Implementation

@optionalTypeArgs
static Future<T> pushReplacementNamed<T extends Object, TO extends Object>(BuildContext context, String routeName, { TO result }) {
  return Navigator.of(context).pushReplacementNamed<T, TO>(routeName, result: result);
}