Skip to content

Commit f4c374a

Browse files
committed
Replaced enumValueToString with describeEnum.
1 parent 7772ef4 commit f4c374a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/src/utils.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
String enumValueToString(Object o) {
2-
return o.toString().split('.').last;
3-
}
1+
import 'package:flutter/foundation.dart';
42

53
T enumValueFromString<T>(String key, Iterable<T> values) {
64
return values.firstWhere(
7-
(v) => v != null && key == enumValueToString(v),
5+
(v) => v != null && key == describeEnum(v),
86
orElse: () => null,
97
);
108
}

0 commit comments

Comments
 (0)