validator library

Backward-compatible export barrel for validator classes.

Classes

AllValidator
Succeeds if all child validators succeed. Fails on the first failure or collects all failures.
AnyValidator
Succeeds if at least one child validator succeeds. Fails if all fail.
Field
IdValidator<T extends Result>
Base class that adds an identifier to a validator (used by map/field validators).
IValidator
Immutable base class from which all validators inherit.
IWhenValidator
A special type of validator that can operate on a parent map context.
MapValidator<T extends Map>
Abstract class for schema-like map validators composed of Field/IdValidator instances.
MultiValidatorBase
An abstract base for validators that operate on a list of child validators.
NoneValidator
Succeeds if all child validators fail. Fails if any succeed.
NotValidator
ThrowInsteadValidator
Validator<T extends Result>
Generic implementation wrapper for a validator.
WhenValidator
WhenWithMessage

Typedefs

ValidatorFunction<T extends Result> = FutureOr<T> Function(dynamic value)
Type representing a validator function (may be sync or async).

Exceptions / Errors

AsyncValidatorException
Thrown when a synchronous validate() call encounters an async validator chain.
ValidatorFailedException
Thrown when a validation fails and validateOrThrow() is used.