Skip to content

Instantly share code, notes, and snippets.

@muchirijane
Created September 26, 2019 03:30
Show Gist options
  • Save muchirijane/b4a27ce9a85039831fd3563061ca8240 to your computer and use it in GitHub Desktop.
Save muchirijane/b4a27ce9a85039831fd3563061ca8240 to your computer and use it in GitHub Desktop.
//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