Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement