getRandomSoundNextPlay method

NextRun<RandomSound> getRandomSoundNextPlay(
  1. RandomSound randomSound
)

Get the next run for the given randomSound.

Implementation

NextRun<RandomSound> getRandomSoundNextPlay(final RandomSound randomSound) =>
    randomSoundNextPlays.firstWhere(
      (final element) => element.value == randomSound,
      orElse: () {
        final nextRun = NextRun(randomSound);
        randomSoundNextPlays.add(nextRun);
        return nextRun;
      },
    );