nextIntBetween method
Returns a random integer between min
(inclusive) and max
(exclusive),
using a linear probability distribution.
Implementation
int nextIntBetween(int min, int max) {
if (min >= max) {
throw ArgumentError.value(max, 'max', 'Must be greater than min');
}
return min + nextInt(max - min);
}