generators/t_value_specs library

Functions

fixed<V>(V value) TValueGenerator
Returns a generator that always returns the exact supplied value.
futureDate({required Random random, Duration within = const Duration(days: 365)}) TValueGenerator
Returns a generator that produces a DateTime after a deterministic anchor (DateTime.utc(2025)) within the given within duration on each call.
oneOf<V>(List<V> values, {required Random random}) TValueGenerator
Returns a generator that picks a random element from values on each call.
oneOfEnum<E extends Enum>(List<E> values, {required Random random}) TValueGenerator
Returns a generator that picks a random enum value from values on each call.
paragraph({required Random random, int sentences = 3}) TValueGenerator
Returns a generator that produces a paragraph of sentences sentences on each call.
pastDate({required Random random, Duration within = const Duration(days: 365)}) TValueGenerator
Returns a generator that produces a DateTime before a deterministic anchor (DateTime.utc(2025)) within the given within duration on each call.
rangeDouble(double min, double max, {required Random random}) TValueGenerator
Returns a generator that produces a random double in [min, max) on each call.
rangeInt(int min, int max, {required Random random}) TValueGenerator
Returns a generator that produces a random int in [min, max) on each call.
sentence({required Random random, int wordCount = 8}) TValueGenerator
Returns a generator that produces a lowercase lorem sentence of wordCount words on each call.
uuid() TValueGenerator
Returns a generator that produces deterministic pseudo-ids with a monotonically increasing counter.
words({required Random random, int min = 1, int max = 3}) TValueGenerator
Returns a generator that produces between min and max (inclusive) lowercase lorem words joined by a space on each call.