chance library

Functions

randomBool([double? likelihood]) bool
Returns a random boolean value (true or false).
randomDouble(double min, double max) double
Returns a random floating point number from min to max.
randomInt(int min, int max) int
Returns a random integer from min to max, inclusive.
randomItem<T>(Iterable<T> pool) → T
Picks a random item from a non-empty Iterable.
randomItemOrNull<T>(Iterable<T> pool) → T?
Picks a random item from an Iterable or null if it's empty.
randomString(int length, {bool secure = false, String pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'}) String
Returns a random String with a set length.