///枚举类型转string String enumToString(o) => o.toString().split('.').last; ///string转枚举类型 T enumFromString(Iterable values, String value) { return values.firstWhere((type) => type.toString().split('.').last == value, orElse: () => null); }