validate method
Performs type coercion against an input
value, and returns a list of errors if the validation was unsuccessful.
Implementation
@override
ValidationResult<String> validate(String key, String input) {
if (!values.any((v) => v.name == input)) {
//if (input == null) {
// return new ValidationResult<String>._failure(
// ['The enum "$name" does not accept null values.']);
//}
return ValidationResult<String>._failure(
['"$input" is not a valid value for the enum "$name".']);
}
return ValidationResult<String>._ok(input);
}