validate method
Validates the provided value
.
Returns null
if the value is valid; otherwise, returns a validation error message.
Implementation
@override
String? validate(covariant String value) {
if (RegExp(pattern).hasMatch(value)) return null;
return message;
}