KitResult<T> class sealed

A lightweight, allocation-cheap success/failure wrapper used across every KitForge module so callers get one consistent pattern instead of a mix of exceptions, nullable returns and bools.

Implementers

Constructors

KitResult.failure(String message, [Object? cause])
const
factory
KitResult.success(T data)
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isFailure bool
no setter
isSuccess bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dataOr(T fallback) → T
Returns the data on success, or fallback on failure.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<R>({required R success(T data), required R failure(String message, Object? cause)}) → R
Pattern-match both branches without a switch at the call site.

Operators

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