copyWith method

NumberSchema copyWith({
  1. String? description,
  2. num? maximum,
  3. num? minimum,
  4. String? title,
  5. NumberSchemaType? type,
  6. num? defaultValue,
})

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

Implementation

NumberSchema copyWith({
  String? description,
  num? maximum,
  num? minimum,
  String? title,
  NumberSchemaType? type,
  num? defaultValue,
}) =>
    NumberSchema.fromJson({
      ...toJson(),
      if (description != null) 'description': $encode(description),
      if (maximum != null) 'maximum': $encode(maximum),
      if (minimum != null) 'minimum': $encode(minimum),
      if (title != null) 'title': $encode(title),
      if (type != null) 'type': $encode(type),
      if (defaultValue != null) 'default': $encode(defaultValue),
    });