minYear static method

Validator<DateTime> minYear(
  1. int min, {
  2. String? error,
})

Implementation

static Validator<DateTime> minYear(int min, {String? error}) => (
      value,
      context,
    ) {
      final DateTimeResource datetimeResource = context.resources.getOrCreate(
        value.toString(),
        () => DateTimeResource(value),
      );

      if (datetimeResource.isMinYear(min)) return (true, null);
      return (false, error ?? context.errors.stringDateErrors.minYear(min));
    };