switchRandom method

void switchRandom(
  1. int total
)

Implementation

void switchRandom(int total) {
  var random = Random();
  var target = random.nextInt(total);
  while (target == _value.current) {
    target = random.nextInt(total);
  }

  select(target);
}