randomInt function

int randomInt(
  1. int max, {
  2. bool secure = false,
})

Returns a random int.

Same as calling Random().nextInt

Implementation

int randomInt(int max, {bool secure = false}) {
  final rnd = secure ? Random.secure() : Random();
  return rnd.nextInt(max);
}