randomInt function

int randomInt(
  1. int min,
  2. int max
)

Generates a random integer between min and max.

Implementation

int randomInt(int min, int max) {
  assert(min < max, 'The max value must be great than the min value.');
  return (_rnd.nextInt(max - min) + min).floor();
}