getEnum<T> static method
Implementation
static T getEnum<T>(String enumName, List<T> values) {
var cleanedName = reCase(enumName);
for (var i = 0; i < values.length; i++) {
if (cleanedName == getName(values[i])) {
return values[i];
}
}
throw Exception("$cleanedName doesn't exist in the list of enums $values");
}