enumFromString<T> function
Implementation
T enumFromString<T>(Iterable<T> values, String value) {
return values.firstWhere(
(type) => equalsIgnoreCase(type.toString().split(".").last, value),
orElse: () => values.first);
}