validateValue method
Validates the value.
Returns null
if the value is valid, otherwise an error message.
Call validate() instead of this method when using the validator.
Implementation
@override
String? validateValue(T valueCandidate) {
return values.where((T element) => element == valueCandidate).length != 1
? errorText
: null;
}