copyWith method

  1. @override
StringSchema copyWith({
  1. bool? isNullable,
  2. bool? isOptional,
  3. String? description,
  4. List<Constraint<String>>? constraints,
  5. List<Refinement<String>>? refinements,
})
override

Returns a copy of this schema with the given fields replaced.

Implementation

@override
StringSchema copyWith({
  bool? isNullable,
  bool? isOptional,
  String? description,
  List<Constraint<String>>? constraints,
  List<Refinement<String>>? refinements,
}) {
  return StringSchema(
    isNullable: isNullable ?? this.isNullable,
    isOptional: isOptional ?? this.isOptional,
    description: description ?? this.description,
    constraints: constraints ?? this.constraints,
    refinements: refinements ?? this.refinements,
  );
}