Created
August 31, 2023 05:05
-
-
Save mono0926/0952fc69a03b638665da268b31659f8b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void main() { | |
print(Animal.dog.name); // 'dog' | |
print(Animal2.dog.name); // '🐶' | |
// Animal2 から 元々のnameのdog・cat文字列を得たい🤔 | |
} | |
enum Animal { | |
dog, | |
cat, | |
} | |
enum Animal2 { | |
dog('🐶'), | |
cat('🐱'), | |
; | |
const Animal2(this.name); | |
final String name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment