ZardResult<T> class

Constructors

ZardResult({required bool success, T? data, ZardError? error})

Properties

data → T?
final
error ZardError?
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
success bool
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
unwrap() → T
Returns data or throws the ZardError if parsing failed.
unwrapOrNull() → T?
Returns data on success, or null on failure — never throws.
when<R>({required R success(T data), required R error(ZardError error)}) → R
Pattern-matches on success/failure, similar to Zod's .safeParse() handling.

Operators

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