inList static method

String? Function(String?) inList(
  1. Iterable<String> allowed, {
  2. String errorMessage = 'Value is not allowed',
})

Ensures the string is one of the allowed values.

Implementation

static String? Function(String?) inList(
  Iterable<String> allowed, {
  String errorMessage = 'Value is not allowed',
}) {
  return _build(errorMessage, (v) => isIn(v, allowed));
}