inList method

Validator inList(
  1. List<String> values, {
  2. String? message,
})

Ensures the value exactly matches one of the items in the provided list.

Implementation

Validator inList(List<String> values, {String? message}) {
  _rules.add(InListRule(values, message ?? _messages.inList));
  return this;
}