random property
num
random
Generates a random number between 0 and this number. If this number is an integer, the result is an integer. If this number is a double, the result is a double scaled by this value.
Implementation
num get random => this is int ? Random().nextInt(this as int) : Random().nextDouble() * this;