validateValue method
Validates the value.
Returns null
if the value is valid, otherwise an error message.
Call validate() instead of this method when using the validator.
Implementation
@override
String? validateValue(String valueCandidate) {
final DateTime? date = DateTime.tryParse(valueCandidate);
if (date == null || date.isBefore(minDate) || date.isAfter(maxDate)) {
return errorText;
}
return null;
}