isEven method

FieldValidator<T, int> isEven([
  1. MessageCallBack<int>? message
])

check if the value is even number

Implementation

FieldValidator<T, int> isEven([MessageCallBack<int>? message]) {
  return next((messages, value) {
    if (!value.isEven) {
      return message?.call(messages, value) ?? messages.isEven;
    }
    return null;
  });
}