randomInt function

int randomInt({
  1. int? max,
})

Generates a non-negative random integer uniformly distributed in the range rom 0, inclusive, to max, exclusive. default max is 1_000_000

Implementation

int randomInt({int? max}) => Random().nextInt(max ?? 1000000);