Enumerated Types #2
Explore how to work with Dart enums by iterating their members and applying extension methods. Understand how to add custom properties and methods to enums to manage app states effectively.
We'll cover the following...
We'll cover the following...
In the last lesson, we learned how to use switch blocks for Enums. In this lesson, you will learn to iterate over members of Weather enumeration.
Iterating
Let’s revisit the Enum Weather:
enum Weather {
sunny,
cloudy,
rainy,
}
The members of the Enums can be listed using Weather.values. The Weather.values ...