replaceWithNamedRouteWithArgs method

void replaceWithNamedRouteWithArgs({
  1. String? routeName,
  2. Map<String, dynamic>? args,
})

Replaces the current route with a named route and optional args.

If a valid BuildContext is provided, this method replaces the current route with the specified named route and passes optional route-specific args.

Implementation

void replaceWithNamedRouteWithArgs({String? routeName, Map<String,dynamic>? args}) {
  Navigator.pushReplacementNamed(
    context,
    routeName!,
    arguments: args,
  );
}