validate method
Returns String
containing the error message if value
is invalid.
or null
when value
is valid.
Implementation
@override
String? validate(String? value) {
if (value == null) return null;
if (min != null && value.length < min!) return message;
if (max != null && value.length > max!) return message;
return null;
}