T? getEnumFromString<T>(Iterable<T> values, String? str) { return values.firstWhereOrNull((f) => f.toString().split('.').last == str); }