containsValueFn method

FieldValidator<T, Map<TKey, TValue>> containsValueFn(
  1. ValueGetter<TValue> value, [
  2. MessageCallBack<Map<TKey, TValue>>? message
])

check if the value contains value

Implementation

FieldValidator<T, Map<TKey, TValue>> containsValueFn(
    ValueGetter<TValue> value,
    [MessageCallBack<Map<TKey, TValue>>? message]) {
  return next((messages, v) {
    var val = value();
    return !v.containsValue(val)
        ? message?.call(messages, v) ?? messages.containsItem(val)
        : null;
  });
}