rangeInt function
Returns a generator that produces a random int in [min, max) on each
call.
Throws ArgumentError if max is not greater than min.
Implementation
TValueGenerator rangeInt(
int min,
int max, {
required Random random,
}) {
_requireMinLessThanMax(min, max);
return () => min + random.nextInt(max - min);
}