Enum
- The reason you need to put the enum outside of the
mainfunction is that enums are classes. Classes define new data types, and Dart requires these class definitions to be outside of functions.
- Enums are not stored as int! Get an int val by
enumName.Value.index
enum Weather {
sunny,
snowy,
cloudy,
rainy,
}