int randomBetween(int from, int to) { if (from > to) throw Exception('$from cannot be > $to'); final rand = Random(); return ((to - from) * rand.nextDouble()).toInt() + from; }