generators library
Sub-path import for hegeltest and Flutter value generators.
import 'package:hegeltest_flutter/generators.dart';
Classes
-
Generator<
T>
Functions
-
alignments(
) → Generator< Alignment> -
Generates Alignment values, covering both standard corner/edge presets and continuous
[-1, 1]coordinates. -
bigIntegers(
{BigInt? min, BigInt? max}) → Generator< BigInt> - Generates random BigInt values.
-
booleans(
{double p = 0.5}) → Generator< bool> - Generates random boolean values.
-
borderRadii(
{double minRadius = 0.0, double maxRadius = 100.0, bool circularOnly = false}) → Generator< BorderRadius> - Generates non-negative BorderRadius values.
-
boxConstraints(
{double minWidth = 0.0, double maxWidth = 2000.0, double minHeight = 0.0, double maxHeight = 2000.0, bool allowUnbounded = false}) → Generator< BoxConstraints> -
Generates normalized BoxConstraints where
minWidth <= maxWidthandminHeight <= maxHeight. -
brightnesses(
) → Generator< Brightness> -
Generates Brightness values (
dark,light). -
bytes(
{int minSize = 0, int maxSize = 100}) → Generator< Uint8List> - Generates a Uint8List of random bytes.
-
colors(
{bool allowAlpha = true}) → Generator< Color> -
Generates arbitrary Color values across RGB channels (and alpha if
allowAlphaistrue). -
dates(
{DateTime? min, DateTime? max}) → Generator< DateTime> - Generates DateTime values containing only a date component.
-
dateTimes(
{DateTime? min, DateTime? max}) → Generator< DateTime> - Generates full DateTime values with both date and time.
-
deferred<
T> (Generator< T> definition()) → Generator<T> -
Returns a generator whose
definitionis evaluated lazily on first use, enabling self-referential and mutually recursive generator graphs. -
domains(
{int maxLength = 255}) → Generator< String> - Generates domain names.
-
doubles(
{double min = double.negativeInfinity, double max = double.infinity, bool allowNan = true, bool allowInfinity = true, bool excludeMin = false, bool excludeMax = false, double smallestNonzeroMagnitude = 5e-324}) → Generator< double> - Generates random double-precision floating-point numbers.
-
durations(
{Duration? min, Duration? max}) → Generator< Duration> -
Generates Duration values between
minandmax(inclusive). -
edgeInsets(
{double min = 0.0, double max = 100.0, bool symmetricOnly = false}) → Generator< EdgeInsets> - Generates non-negative EdgeInsets values.
-
emails(
) → Generator< String> - Generates valid-looking email addresses.
-
frequency<
T> (List< (int, Generator< weighted) → Generator<T> )>T> - Selects a generator based on provided probability weights.
-
fromRegex(
String pattern, {bool fullmatch = true}) → Generator< String> - Generates strings that match a given regular expression pattern.
-
integers(
{int min = -9223372036854775808, int max = 9223372036854775807}) → Generator< int> - Generates random integers.
-
ipv4Addresses(
) → Generator< InternetAddress> - Generates IPv4 InternetAddress values.
-
ipv6Addresses(
) → Generator< InternetAddress> - Generates IPv6 InternetAddress values.
-
lists<
T> (Generator< T> elements, {int minSize = 0, int maxSize = 9223372036854775807}) → Generator<List< T> > - Generates lists of elements from the provided generator.
-
locales(
[List< Locale> ? choices]) → Generator<Locale> -
Picks a Locale from
choices(or a curated default set covering LTR, RTL, and CJK scripts). -
maps<
K, V> (Generator< K> keys, Generator<V> values, {int minSize = 0, int maxSize = 9223372036854775807}) → Generator<Map< K, V> > - Generates maps with unique keys and corresponding values.
-
nullable<
T> (Generator< T> gen, {double nullProbability = 0.5}) → Generator<T?> - Wraps a generator to occasionally produce null.
-
offsets(
{double minDx = -1000.0, double maxDx = 1000.0, double minDy = -1000.0, double maxDy = 1000.0}) → Generator< Offset> - Generates 2D Offset values within the given finite coordinate bounds.
-
oneOf<
T> (List< Generator< gens) → Generator<T> >T> - Picks one of the provided generators uniformly at random.
-
oneOfWeighted<
T> (List< (int, Generator< weighted) → Generator<T> )>T> - Selects a generator based on provided probability weights.
-
recursive<
T> (Generator< T> base, Generator<T> extend(Generator<T> children), {int maxDepth = _defaultMaxDepth, int maxLeaves = _defaultMaxLeaves}) → Generator<T> -
Generates recursively structured values such as trees, ASTs, or JSON
documents whose leaves come from
base. -
sampled<
T> (List< T> values) → Generator<T> - Picks a value randomly from a fixed list of values.
-
sampledWeighted<
T> (List< (int, T)> weighted) → Generator<T> - Picks a value randomly from a list of weighted values.
-
sets<
T> (Generator< T> elements, {int minSize = 0, int maxSize = 9223372036854775807}) → Generator<Set< T> > - Generates sets of unique elements from the provided generator.
-
sizes(
{double minWidth = 0.0, double maxWidth = 2000.0, double minHeight = 0.0, double maxHeight = 2000.0}) → Generator< Size> - Generates non-negative Size values within the given bounds.
-
text(
{int minSize = 0, int maxSize = 100, int minCodepoint = 0, int maxCodepoint = 0x10FFFF}) → Generator< String> - Generates random text strings.
-
textDirections(
) → Generator< TextDirection> -
Generates TextDirection values (
ltr,rtl). -
textScalers(
{double minScale = 0.5, double maxScale = 3.0}) → Generator< TextScaler> -
Generates linear TextScaler values with scale factor in
[minScale, maxScale]. -
themeModes(
) → Generator< ThemeMode> -
Generates ThemeMode values (
system,light,dark). -
times(
{TimeRecord? min, TimeRecord? max}) → Generator< TimeRecord> - Generates TimeRecord values containing only a time component.
-
tuples2<
A, B> (Generator< A> a, Generator<B> b) → Generator<(A, B)> - Generates 2-tuples (pairs) of independent values.
-
tuples3<
A, B, C> (Generator< A> a, Generator<B> b, Generator<C> c) → Generator<(A, B, C)> - Generates 3-tuples of independent values.
-
tuples4<
A, B, C, D> (Generator< A> a, Generator<B> b, Generator<C> c, Generator<D> d) → Generator<(A, B, C, D)> - Generates 4-tuples of independent values.
-
urls(
) → Generator< String> - Generates valid-looking URLs.
-
uuids(
) → Generator< String> - Generates v4 UUIDs.