randomInt function

int randomInt({
  1. required int min,
  2. required int max,
})

expect a min and max number and return a random number between them

Implementation

int randomInt({required int min, required int max}) {
  final random = math.Random();
  return min + random.nextInt(max - min);
}