date method
FormFieldValidator
that requires the field's value to be a valid date string.
Implementation
static FormFieldValidator date({
String errorText = "This field requires a valid date string.",
}) {
return (val) {
if (val != null && val.isNotEmpty) {
if (!isDate(val)) return errorText;
}
};
}