Rnd class

Constructors

Rnd()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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 Properties

random Random
getter/setter pair
ratio → dynamic
Gets the next double.
no setter
seed int
getter/setter pair

Static Methods

getBool([double chance = 0.5]) bool
Gets a random boolean with chance chance.
getDouble(double min, double max) double
Gets a random double between min and max.
getInt(int min, int max) int
Gets a random int between min and max.
getItem(List list) → dynamic
Randomly selects an item from a list.
getPalette(List<Palette>? palettes, bool dark) Palette
Gets a random palette from a list of palettes and sorts its' colors by luminance.
shuffle(List list) List
Randomize the positions of items in a list.