static T getEnumFromName<T>(Iterable<T> values, String name) { return values.where((value) => getName(value as Object) == name).first; }