pushReplacementNamedRoute<T extends Object?, TO extends Object?> method

void pushReplacementNamedRoute<T extends Object?, TO extends Object?>(
  1. String routeName, {
  2. TO? result,
  3. Object? args,
})

Replaces the current route with a named route.

The routeName parameter specifies the name of the route to push. The result parameter can be used to return a value from the new route. The args parameter can be used to pass arguments to the new route.

Implementation

void pushReplacementNamedRoute<T extends Object?, TO extends Object?>(
  String routeName, {
  TO? result,
  Object? args,
}) {
  Navigator.of(this).pushReplacementNamed<T, TO>(
    routeName,
    result: result,
    arguments: args,
  );
}