copyWith method

TitledSingleSelectEnumSchema copyWith({
  1. String? defaultValue,
  2. String? description,
  3. List<TitledSingleSelectEnumSchemaOneOfItem>? oneOf,
  4. String? title,
})

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

Implementation

TitledSingleSelectEnumSchema copyWith({
  String? defaultValue,
  String? description,
  List<TitledSingleSelectEnumSchemaOneOfItem>? oneOf,
  String? title,
}) =>
    TitledSingleSelectEnumSchema.fromJson({
      ...toJson(),
      if (defaultValue != null) 'default': $encode(defaultValue),
      if (description != null) 'description': $encode(description),
      if (oneOf != null) 'oneOf': $encode(oneOf),
      if (title != null) 'title': $encode(title),
    });