I have a Dart enum in my Flutter project like this:
enum RepeatState {
playSongOnce,
repeatSong,
repeatPlaylist,
}
If I have some random enum state like RepeatState.repeatSong, how do I iterate to the next enum (without doing something like mapping them with a switch statement)?
I found the answer with the help of this, this and this, so I'm posting it below.