integer method

int integer (
  1. int max,
  2. {int min: 0}
)

Generates a random integer with the given max value and to the lowest min value if provided.

Example:

  random.integer(10);

  random.integer(10, min: 5);

Implementation

int integer(int max, {int min = 0}) =>
    max == min ? max : _rng.nextInt(max - min) + min;