Created
September 26, 2019 03:30
-
-
Save muchirijane/b4a27ce9a85039831fd3563061ca8240 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
//How to use enum | |
void main () { | |
Car myCar = Car(carStyle: CarType.convertable); | |
print(myCar); | |
} | |
class Car { | |
// int carStyle; | |
CarType carStyle; | |
Car({this.carStyle}); | |
} | |
enum CarType { | |
probox, | |
hatchBack, | |
convertable | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment