copyWith method

FieldRule copyWith({
  1. YamlValueType? type,
  2. bool? required,
  3. List<String>? allowedValues,
  4. RegExp? matchesPattern,
  5. Map<String, FieldRule>? nestedFields,
  6. Map<RegExp, FieldRule?>? recursiveMapSchema,
})

Implementation

FieldRule copyWith({
  YamlValueType? type,
  bool? required,
  List<String>? allowedValues,
  RegExp? matchesPattern,
  Map<String, FieldRule>? nestedFields,
  Map<RegExp, FieldRule?>? recursiveMapSchema,
}) {
  return FieldRule(
    type: type ?? this.type,
    required: required ?? this.required,
    allowedValues: allowedValues ?? this.allowedValues,
    matchesPattern: matchesPattern ?? this.matchesPattern,
    nestedFields: nestedFields ?? this.nestedFields,
    recursiveMapSchema: recursiveMapSchema ?? this.recursiveMapSchema,
  );
}