isBefore method Null safety
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}';