containsElement<T> static method
FormFieldValidator that requires the field's value to be in a list of values.
Parameters:
valuesThe list of values that the field's value should be in.errorTextThe error message when the value is not in the list.checkNullOrEmptyWhether to check for null or empty values.
Implementation
static FormFieldValidator<T> containsElement<T>(
List<T> values, {
String? errorText,
bool checkNullOrEmpty = true,
}) => ContainsElementValidator<T>(
values,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;