copyWith method

PromptArgument copyWith({
  1. String? description,
  2. String? name,
  3. bool? required,
  4. String? title,
})

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

Implementation

PromptArgument copyWith({
  String? description,
  String? name,
  bool? required,
  String? title,
}) =>
    PromptArgument.fromJson({
      ...toJson(),
      if (description != null) 'description': $encode(description),
      if (name != null) 'name': $encode(name),
      if (required != null) 'required': $encode(required),
      if (title != null) 'title': $encode(title),
    });