integer method
Generates a random integer with the given max
(exclusive) value
and to the lowest min
(inclusive) value if provided.
Example:
random.integer(10);
random.integer(10, min: 5);
Implementation
int integer(int max, {int min = 0}) =>
max == min ? max : _random.nextInt(max - min) + min;