validate method
Return an error message if the value is invalid, otherwise return null.
Implementation
@override
String? validate(dynamic value) {
if(value is! List) {
if(value is! String) {
return "Expected value for $name to be a list";
}
value = value.split("[ ,]");
}
if(findChoice(wildcardValue) == null) {
for(final textValue in value) {
final choice = findChoice(textValue);
if(choice == null) {
return "$textValue is not a valid choice for $name";
}
}
}
return null;
}