AsyncRefineValidator<T> class

Async refine layer — requires ValidatorExtensions.safeParseAsync.

Inheritance
Implemented types
Available extensions

Constructors

AsyncRefineValidator(Validator<T> _inner, Future<bool> _predicate(T value), List<String>? _customPath, String _code, Map<String, dynamic>? _params, {String? message, bool isSecret = false})

Properties

customPath List<String>?
no setter
errorCode String
no setter
errorMessage String?
no setter
errorParams Map<String, dynamic>?
no setter
hashCode int
The hash code for this object.
no setterinherited
inner Validator<T>
no setter
isCompiled bool
True when this validator was produced by compile / ValidatorCompiler.
no setteroverride
isPure bool
True when no rules, transforms, or wrappers are attached.
no setterinherited
isSecret bool
finalinherited
predicate Future<bool> Function(T value)
no setter
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.
inherited
compile() Validator<T>

Available on Validator<T>, provided by the CompileExtension extension

12.3 — compiles this schema into a cached, optimized validator tree.
defaultValue(T value) → DefaultDecorator<T>

Available on Validator<T>, provided by the DefaultExtension extension

Deprecated — use withDefault.
getFieldSchema(String key) Validator?
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nullable() NullableValidator<T>

Available on Validator<T>, provided by the NullableExtension extension

Makes the validator nullable, allowing null values
optional() OptionalValidator<T>

Available on Validator<T>, provided by the OptionalExtension extension

parse(dynamic value, {bool? abortEarly}) → T

Available on Validator<T>, provided by the ValidatorExtensions extension

Validates value and 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<T>, provided by the RefineExtension extension

Custom predicate on any schema (objects and leaf primitives).
refineAsync(Future<bool> predicate(T value), {List<String>? path, String? code, String? message, Map<String, dynamic>? params}) AsyncRefineValidator<T>

Available on Validator<T>, provided by the RefineExtension extension

Async variant of refine; use with safeParseAsync.
safeParse(dynamic value, {bool? abortEarly}) ParseResult<T>

Available on Validator<T>, provided by the ValidatorExtensions extension

Validates value without throwing.
safeParseAsync(dynamic value, {bool? abortEarly}) Future<ParseResult<T>>

Available on Validator<T>, provided by the ValidatorExtensions extension

Async parse — required for schemas with refineAsync / superRefineAsync / LazyValidator wrapping async inners.
secret() AsyncRefineValidator<T>
override
stopOnFirstError() Validator<T>
override
strict() Validator<T>
override
superRefine(void callback(T value, SuperRefineContext ctx)) Validator<T>

Available on Validator<T>, provided by the SuperRefineExtension extension

Zod-compatible .superRefine() — attach multiple custom issues.
superRefineAsync(Future<void> callback(T value, SuperRefineContext ctx)) AsyncSuperRefineValidator<T>

Available on Validator<T>, provided by the SuperRefineExtension extension

Async variant of superRefine; use with safeParseAsync.
toString() String
A string representation of this object.
inherited
transform<R>(R cb(T value)) Validator<R>
inherited
validate(dynamic value, {FlodPath path = const FlodPath([]), bool? abortEarly}) ParseResult<T>
override
validateAsync(dynamic value, {FlodPath path = const FlodPath([]), bool? abortEarly}) Future<ParseResult<T>>
override
withDefault(T value) → DefaultDecorator<T>

Available on Validator<T>, provided by the DefaultExtension extension

Zod-compatible default when input is missing/null.
withDefaultFactory(T create()) → DefaultDecorator<T>

Available on Validator<T>, provided by the DefaultExtension extension

Factory default — create runs on every missing/null input.

Operators

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