isBefore method Null safety

String? isBefore(
  1. String? value,
  2. {String? message,
  3. required dynamic max}
)

Check if the value (a Date) is before the given Date.

Implementation

static String? isBefore(String? value, {String? message, required max}) => value == null || value.isEmpty || validations.isBefore(value, max) == true
    ?  null
    : message ?? 'Please enter a date before ${max.runtimeType.toString() == 'DateTime' ? max.toString().substring(0, 10) : max}';