validate method
Function to validate the form input. It takes a string and returns an String error message if the input is invalid or null if the input is valid.
Implementation
@override
String? validate(
BuildContext context,
String fieldName,
String? value,
) {
if (value != null && value.isNotEmpty) {
_isValid = callback(value);
} else {
_isValid = true;
}
return _shortErrorMessage;
}