call method

  1. @override
String? call(
  1. DateTime? value
)
override

Implementation

@override
String? call(DateTime? value) {
  if (value == null) return null;
  if (min != null && value.isAfter(min!)) {
    return resolveBoundsError(
      BoundsViolation.belowMin,
      () => 'Should be after ${formatDate(min)}',
    );
  }
  if (max != null && value.isBefore(max!)) {
    return resolveBoundsError(
      BoundsViolation.aboveMax,
      () => 'Should be before ${formatDate(max)}',
    );
  }
  return null;
}