pushReplacementNamed<T extends Object, TO extends Object> method

Future<T?> pushReplacementNamed<T extends Object, TO extends Object>(
  1. String routeName, {
  2. Object? args,
})

Replace the current route of the navigator by pushing the given route and then disposing the previous route once the new route has finished animating in.

Implementation

Future<T?> pushReplacementNamed<T extends Object, TO extends Object>(
    String routeName,
    {Object? args}) async {
  return navigationKey.currentState?.pushReplacementNamed<T, TO>(
    routeName,
    arguments: args,
  );
}