containsElement<T> static method
FormFieldValidator that requires the field's value to be in a list of values.
Parameters:
values
The list of values that the field's value should be in.errorText
The error message when the value is not in the list.checkNullOrEmpty
Whether 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;