copyWith method

Prompt copyWith({
  1. List<PromptArgument>? arguments,
  2. String? description,
  3. String? name,
  4. Map<String, Object?>? meta,
  5. String? title,
  6. List<McpIcon>? icons,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

Prompt copyWith({
  List<PromptArgument>? arguments,
  String? description,
  String? name,
  Map<String, Object?>? meta,
  String? title,
  List<McpIcon>? icons,
}) =>
    Prompt.fromJson({
      ...toJson(),
      if (arguments != null) 'arguments': $encode(arguments),
      if (description != null) 'description': $encode(description),
      if (name != null) 'name': $encode(name),
      if (meta != null) '_meta': $encode(meta),
      if (title != null) 'title': $encode(title),
      if (icons != null) 'icons': $encode(icons),
    });