toMap method
Implementation
@override
Map<String, Object?> toMap() {
return {
...super.toMap(),
if (minLength != null) 'minLength': minLength,
if (maxLength != null) 'maxLength': maxLength,
if (format != null) 'format': format!.value,
};
}