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

Future<T?> replace<T extends Object?, TO extends Object?>(
  1. String route, {
  2. Object? state,
  3. TO? result,
})

Replace the current route with the new route. The state is passed as the route arguments. result is used to resolve the Future of the current route.

Implementation

Future<T?> replace<T extends Object?, TO extends Object?>(
  String route, {
  Object? state,
  TO? result,
}) {
  return _navigatorKey.currentState!.pushReplacementNamed<T?, TO?>(
    route,
    arguments: state,
    result: result,
  );
}