validate method
Implementation
@override
void validate(String? newValue) {
final String? _newValue = newValue;
if (_newValue == null) {
if (isRequired) {
throw InvalidValueException();
} else {
return;
}
}
final bool hasMatch = regExp.hasMatch(_newValue);
if (hasMatch == false) {
throw InvalidValueException();
}
}