dateRange static method
FormFieldValidator that requires the field's value to be a date within a certain range.
Parameters:
minDateThe minimum date that the field's value should be greater than or equal to.maxDateThe maximum date that the field's value should be less than or equal to.errorTextThe error message when the date is not in the range.checkNullOrEmptyWhether to check for null or empty values.
Implementation
static FormFieldValidator<String> dateRange(
DateTime minDate,
DateTime maxDate, {
String? errorText,
bool checkNullOrEmpty = true,
}) => DateRangeValidator(
minDate,
maxDate,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;