randomInt function
Returns a random integer from min to max, inclusive.
Implementation
int randomInt(int min, int max) {
if (min > max) {
throw RangeError('max must be greater than min');
}
return (_random.nextDouble() * (max - min + 1) + min).floor();
}