random function Null safety
Produces a random number between the inclusive lower and upper bounds.
Implementation
num random(num lower, num upper, [bool floating = false]) {
if (floating) {
return math.Random().nextDouble() * (upper - lower) + lower;
}
return math.Random().nextInt(upper.toInt() - lower.toInt()) + lower;
}