RandomInteger class Null safety
Random generator for integer values.
Example
var value1 = RandomInteger.nextInteger(5, 10); // Possible result: 7
var value2 = RandomInteger.nextInteger(10); // Possible result: 3
var value3 = RandomInteger.updateInteger(10, 3); // Possible result: 9
Constructors
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited
Static Methods
-
nextInteger(
int min, [int? max]) → int -
Generates a integer in the range
'min', 'max'
. If 'max' is omitted, then the range will be set to0, 'min'
. [...] -
sequence(
int min, [int? max]) → List< int> -
Generates a random sequence of integers starting from 0 like:
0,1,2,3...??
[...] -
updateInteger(
int value, [int? range]) → int - Updates (drifts) a integer value within specified range defined [...]