Last active
December 13, 2021 20:37
-
-
Save OnlyTarg/4d385aa60850e41f05cac06f12bb1437 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum MyEnum { one, two, three } | |
void main() { | |
print(MyEnum.one); | |
print(MyEnum.one.name); // one | |
final map = MyEnum.values.asNameMap(); | |
print(map); | |
print(MyEnum.values.byName('two')); | |
//print(MyEnum.values.byName('two1')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment