before function
Validates that fieldValue
(DateTime) is before checkValue
.
Returns null
if fieldValue
< checkValue
else an error message
Implementation
String before(
DateTime fieldValue,
DateTime checkValue, {
String message,
}) {
if ((fieldValue == null) || (fieldValue.isBefore(checkValue))) {
return null;
}
return message ?? 'Please enter a value in the past of $checkValue';
}