int method

int int({
  1. int min = 0,
  2. int? max,
  3. bool only32bit = false,
  4. bool only64bit = false,
})

generates a random integer whose value falls between min (inclusive) and max (exclusive)

only32bit and only64bit will limit generated numbers to 32-bit or 64-bit integers (respectively). Setting both to true throws an ArgumentError Omitting both or setting both to false will randomly generate elements of both types If only32bit is set to true, then the value passed for min must be limited to a 32-bit max value; passing a number outside the 32-bit space will throw an ArgumentError

Implementation

$core.int int({$core.int min = 0, $core.int? max, bool only32bit = false, bool only64bit = false}) {
  return ints(1, max: max, min: min, only32bit: only32bit, only64bit: only64bit).first;
}