isBeforeFn method

FieldValidator<T, TimeOfDay> isBeforeFn(
  1. ValueGetter<TimeOfDay> other, [
  2. MessageCallBack<TimeOfDay>? message
])

check if the value is before other

Implementation

FieldValidator<T, TimeOfDay> isBeforeFn(ValueGetter<TimeOfDay> other,
    [MessageCallBack<TimeOfDay>? message]) {
  return next((messages, value) {
    var oth = other();
    if (!value.isBefore(oth)) {
      return message?.call(messages, value) ??
          messages.isTimeBefore(_dateTime(oth));
    }
    return null;
  });
}