random static method
Returns a random integer in [min, max] (inclusive).
Pass seed for a deterministic sequence (useful in tests). The default
upper bound is 0x7fffffff (2^31 - 1) so the call is safe on all
platforms including dart2js.
Implementation
static int random({int min = 0, int max = 0x7fffffff, int? seed}) {
if (max < min) throw ArgumentError('max must be >= min');
final rng = seed == null ? _random : math.Random(seed);
return min + rng.nextInt(max - min + 1);
}