Destiny class
This is a static class containing methods for creating randomized/mock data.
It uses a PCG generator underneath, but exposes practical usages.
Constructors
- Destiny()
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 Methods
-
address(
{String? street}) → String - Returns a random, mocked street address. The number is wholly random and the street suffix is randomly selected out of 6 common suffixes.
-
boolean(
) → bool - Get a random boolean.
-
coin(
) → String - Flip a two-sided coin. Returns 'Tails' or 'Heads'.
-
d10(
) → int - Roll a ten-sided dice. Returns an integer in 1-10 (inclusive).
-
d100(
) → int - Roll a hundred-sided dice. Returns an integer in 1-100 (inclusive).
-
d20(
) → int - Roll a twenty-sided dice. Returns an integer in 1-20 (inclusive).
-
d30(
) → int - Roll a thirty-sided dice. Returns an integer in 1-30 (inclusive).
-
d4(
) → int - Roll a four-sided dice. Returns an integer in 1-4 (inclusive).
-
d6(
) → int - Roll a six-sided dice. Returns an integer in 1-6 (inclusive).
-
d8(
) → int - Roll a eight-sided dice. Returns an integer in 1-8 (inclusive).
-
datetime(
{DateTime? min, DateTime? max}) → DateTime - Returns a random DateTime between min and max. By default, min is the UTC epoch and max is the current time.
-
digits(
int length) → String - Returns a string of digits.
-
email(
) → String - Generate a random email. The user section is based off a random name and the domain is a common adjective of the english language.
-
femaleName(
) → String - Generate a random female name, pulled from a pool of 1000 possibilities for both the first and last names.
-
guid(
) → String - Generate a random GUID.
-
integer(
{int min = -2147483647, int max = 2147483647}) → int - Get an integer between min and max (inclusive).
-
ipv4(
) → String - Generate a random IPv4 address. This address is entirely randomized, so there is no guarantee that it is a valid address.
-
ipv6(
) → String - Generate a random IPv6 address. This address is entirely randomized, so there is no guarantee that it is a valid address.
-
letters(
int length) → String - Returns a string of random English letters.
-
maleName(
) → String - Generate a random male name, pulled from a pool of 1000 possibilities for both the first and last names.
-
name(
) → String - Generate a random name, pulled from a pool of 1000 possibilities for both the first and last names. This name can be either male or female.
-
phone(
) → String - Returns a random, mocked phone number (formatted (XXX) XXX-XXXX).
-
string(
int length, {String? pool}) → String - Returns a string of random characters.