RootBuilder class

Root builder that provides entry points for different data types.

Usage Examples:

// String validation
final nameValidator = v().string().lengthMin(2).lengthMax(100).build();

// Number validation with coercion
final ageValidator = v().string().toInt().gte(0).lte(150).build();

// Complex object validation
final userValidator = v().map().schema({
  'name': v().string().lengthMin(1).build(),
  'email': v().string().email().build(),
  'age': v().int_().gte(18).build(),
}).build();

// List validation
final tagsValidator = v().list().each(v().string().lengthMin(1).build()).build();

Constructors

RootBuilder()

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

bool({String? message}) BoolBuilder
Expect a bool; returns a BoolBuilder with boolean-specific methods.
dateTime({String? message}) DateTimeBuilder
Expect a DateTime; returns a DateTimeBuilder with date/time methods.
double_({String? message}) DoubleBuilder
Expect a double; returns a DoubleBuilder with double-specific methods.
int_({String? message}) IntBuilder
Expect an int; returns an IntBuilder with integer-specific methods.
iterable<T>({String? message}) IterableBuilder<T>
Expect an Iterable; returns an IterableBuilder with collection methods.
list<T>({String? message}) ListBuilder<T>
Expect a List; returns a ListBuilder with list-specific methods.
map<K, V>({String? message}) MapBuilder<K, V>
Expect a Map; returns a MapBuilder with map-specific methods.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
number({String? message}) NumberBuilder
Expect a number (int or double); returns a NumberBuilder with numeric methods.
set<T>({String? message}) SetBuilder<T>
Expect a Set; returns a SetBuilder with set-specific methods.
string({String? message}) StringBuilder
Expect a String; returns a StringBuilder with string‑specific methods.
toString() String
A string representation of this object.
inherited
type<T>({String? message}) GenericBuilder
Generic type guard (rarely needed; concrete helpers preferred).

Operators

operator ==(Object other) bool
The equality operator.
inherited