validart library

Classes

AmexBrand
Matches American Express cards.
AsyncValidator<T>
Abstract base class for async validators.
CaPostalCodePattern
Matches Canadian postal codes (A1A 1A1 — space optional).
CardBrandPattern
A pluggable credit-card brand matching strategy.
CaSinPattern
Matches Canadian Social Insurance Numbers — 9 digits with Luhn check.
DinersBrand
Matches Diners Club cards.
DiscoverBrand
Matches Discover cards.
E164PhonePattern
Default phone pattern — validates E.164 format (+ followed by 2–15 digits).
JcbBrand
Matches JCB cards.
LicensePlatePattern
A pluggable license-plate validation strategy.
MastercardBrand
Matches Mastercard cards.
PhonePattern
A pluggable phone-number validation strategy.
PostalCodePattern
A pluggable postal-code validation strategy.
TaxIdPattern
A pluggable tax-identifier validation strategy.
UkNiNumberPattern
Matches UK National Insurance numbers (AB123456C).
UkPlatePattern
Matches UK license plates in the current format (post-2001): two letters + two digits + three letters, with an optional space between the two groups (AB12 CDE or AB12CDE).
UkPostcodePattern
Matches UK postcodes (common format; full RFC is more permissive).
UsSsnPattern
Matches US Social Security Numbers (123-45-6789 or 123456789).
UsZipPattern
Matches US ZIP codes (12345 or 12345-6789).
V
Entry point for creating validation schemas.
Validator<T>
Abstract base class for all validators.
VArray<T>
Validates List<T> values, applying the element schema to each item.
VArrayCode
Error codes emitted by VArray and its validators.
VBool
Validates bool values.
VBoolCode
Error codes emitted by VBool and its validators.
VCode
Machine-readable error code constants used by validators.
VCoerce
Provides coercion schemas that convert input values to the target type.
VDate
Validates DateTime values.
VDateCode
Error codes emitted by VDate and its validators.
VDouble
Validates double values.
VDoubleCode
Error codes emitted by VDouble and its validators.
VEnum<T extends Enum>
Validates that a value belongs to a set of enum values.
VEnumCode
Error codes emitted by VEnum and its validators.
VError
Represents a single validation error.
VFailure<T>
A failed validation result containing the list of errors.
VInt
Validates int values.
VIntCode
Error codes emitted by VInt and its validators.
VisaBrand
Matches Visa cards.
VLiteral<T>
Validates that a value is exactly equal to the expected literal.
VLiteralCode
Error codes emitted by VLiteral and its validators.
VLocale
Provides locale-aware error message translations.
VMap
Validates Map<String, dynamic> values against a field schema.
VMapCode
Error codes emitted by VMap and its validators.
VNumber<T extends num>
Abstract base for numeric validation types (VInt and VDouble).
VNumberCode
Error codes shared by VInt and VDouble — range and sign checks that apply to any numeric value.
VObject<T>
Validates class/entity instances of type T via type-safe field extraction callbacks.
VObjectCode
Error codes emitted by VObject and its validators.
VResult<T>
The result of a validation operation.
VString
Validates String values.
VStringCode
Error codes emitted by VString and its validators.
VSuccess<T>
A successful validation result containing the parsed value.
VTransformed<I, O>
Wraps a schema and transforms its output to a different type.
VTransformedAsync<I, O>
Wraps a schema and asynchronously transforms its output to a different type.
VType<T>
Abstract base for all validation types.
VUnion
Validates that a value matches at least one of the given schemas.
VUnionCode
Error codes emitted by VUnion and its validators.

Enums

CountryCodeFormat
Controls whether a leading international dialing code (e.g. +1, +55, +44) is expected on a phone number.
UuidVersion
Supported UUID versions for filtering validation.
ValidationMode
Controls which formatted variants a pattern accepts.

Extensions

VTypeApplyIf on V
Conditional schema construction. Applies a builder transformation to the receiver only when condition is true, returning the receiver unchanged otherwise.

Exceptions / Errors

VAsyncRequiredException
Thrown by synchronous consumers (parse, validate, safeParse, errors) when the schema contains async steps (added via refineAsync).
VException
Exception thrown by VType.parse when validation fails.