dateRange static method

FormFieldValidator<String> dateRange(
  1. DateTime minDate,
  2. DateTime maxDate, {
  3. String? errorText,
  4. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field's value to be a date within a certain range.

Parameters:

  • minDate The minimum date that the field's value should be greater than or equal to.
  • maxDate The maximum date that the field's value should be less than or equal to.
  • errorText The error message when the date is not in the range.
  • checkNullOrEmpty Whether 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;