enumValue<T extends Enum> static method
The one of values whose name matches value, ignoring case, -
and _ (tonal-spot gives tonalSpot); null when none does.
Implementation
static T? enumValue<T extends Enum>(List<T> values, String value) {
final wanted = canonical(value);
for (final candidate in values) {
if (canonical(candidate.name) == wanted) {
return candidate;
}
}
return null;
}