Validator<T> class
abstract
- Implementers
- AsyncRefineValidator
- AsyncSuperRefineValidator
- BaseNumberValidator
- BoolValidator
- CompiledListValidator
- CompiledObjectValidator
- CompiledValidator
- IntValidator
- LazyValidator
- ListValidator
- LiteralValidator
- NullableValidator
- ObjectValidator
- OptionalValidator
- RefineValidator
- StringValidator
- SuperRefineValidator
- UnionValidator
- Available extensions
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCompiled → bool
-
True when this validator was produced by compile / ValidatorCompiler.
no setter
- isPure → bool
-
True when no rules, transforms, or wrappers are attached.
no setter
- isSecret → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
compile(
) → Validator< T> - 12.3 — compiles into a cached, optimized validator tree.
-
compile(
) → Validator< T> -
Available on Validator<
12.3 — compiles this schema into a cached, optimized validator tree.T> , provided by the CompileExtension extension -
defaultValue(
T value) → DefaultDecorator< T> -
Available on Validator<
Deprecated — use withDefault.T> , provided by the DefaultExtension extension -
getFieldSchema(
String key) → Validator? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
nullable(
) → NullableValidator< T> -
Available on Validator<
Makes the validator nullable, allowing null valuesT> , provided by the NullableExtension extension -
optional(
) → OptionalValidator< T> -
Available on Validator<
T> , provided by the OptionalExtension extension -
parse(
dynamic value, {bool? abortEarly}) → T -
Available on Validator<
ValidatesT> , provided by the ValidatorExtensions extensionvalueand returns data, or throws ValidationException. -
parseAsync(
dynamic value, {bool? abortEarly}) → Future< T> -
Available on Validator<
T> , provided by the ValidatorExtensions extension -
refine(
bool predicate(T value), {List< String> ? path, String? code, String? message, Map<String, dynamic> ? params}) → Validator<T> -
Available on Validator<
Custom predicate on any schema (objects and leaf primitives).T> , provided by the RefineExtension extension -
refineAsync(
Future< bool> predicate(T value), {List<String> ? path, String? code, String? message, Map<String, dynamic> ? params}) → AsyncRefineValidator<T> -
Available on Validator<
Async variant of refine; use with safeParseAsync.T> , provided by the RefineExtension extension -
safeParse(
dynamic value, {bool? abortEarly}) → ParseResult< T> -
Available on Validator<
ValidatesT> , provided by the ValidatorExtensions extensionvaluewithout throwing. -
safeParseAsync(
dynamic value, {bool? abortEarly}) → Future< ParseResult< T> > -
Available on Validator<
Async parse — required for schemas with refineAsync / superRefineAsync / LazyValidator wrapping async inners.T> , provided by the ValidatorExtensions extension -
secret(
) → Validator< T> -
stopOnFirstError(
) → Validator< T> -
strict(
) → Validator< T> -
superRefine(
void callback(T value, SuperRefineContext ctx)) → Validator< T> -
Available on Validator<
Zod-compatibleT> , provided by the SuperRefineExtension extension.superRefine()— attach multiple custom issues. -
superRefineAsync(
Future< void> callback(T value, SuperRefineContext ctx)) → AsyncSuperRefineValidator<T> -
Available on Validator<
Async variant of superRefine; use with safeParseAsync.T> , provided by the SuperRefineExtension extension -
toString(
) → String -
A string representation of this object.
inherited
-
transform<
R> (R cb(T value)) → Validator< R> -
validate(
dynamic value, {FlodPath path = const FlodPath([]), bool? abortEarly}) → ParseResult< T> -
withDefault(
T value) → DefaultDecorator< T> -
Available on Validator<
Zod-compatible default when input is missing/T> , provided by the DefaultExtension extensionnull. -
withDefaultFactory(
T create()) → DefaultDecorator< T> -
Available on Validator<
Factory default —T> , provided by the DefaultExtension extensioncreateruns on every missing/nullinput.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited