RandomGenerator class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
amount<T>(T generator(int i), int max, {int min = 1})
→ List<T>
-
Generates a list of random length filled by return value of
fn
.
-
boolean()
→ bool
-
Generates a random boolean.
-
decimal({num scale = 1, num min = 0})
→ double
-
Generates a random decimal.
Accepts a
scale
and a min
value.
-
element<T>(List<T> list)
→ T
-
Plucks a random element from the given
list
.
-
fromCharSet(String charSet, int length)
→ String
-
Generated a random string from the given string of chracters.
-
fromPattern(List pattern)
→ String
-
Generates a random set of numbers from the given
pattern
.
-
fromPatternToHex(List pattern)
→ String
-
Generates a random set of numbers from the given
pattern
.
Returns this pattern
as hex.
-
integer(int max, {int min = 0})
→ int
-
Generates a random integer with the given
max
(exclusive) value
and to the lowest min
(inclusive) value if provided.
-
mapElementKey<T>(Map map)
→ T
-
Plucks a random key from the given
map
.
-
mapElementValue<T>(Map map)
→ T
-
Plucks a random value from the given
map
.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
numberOfLength(int length)
→ String
-
Generates a random string of numbers with a number of characters equal to
length
-
numbers(num max, num times)
→ List<int>
-
Generates a random number from the
max
value
and by the number of times
.
-
string(int max, {int min = 1})
→ String
-
Generates a random string with the given
max
value
and to the lowest min
value if provided.
-
toString()
→ String
-
A string representation of this object.
inherited