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])
-
constfactory
- KitResult.success(T data)
-
constfactory
Properties
Methods
-
dataOr(
T fallback) → T -
Returns the data on success, or
fallbackon 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
switchat the call site.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited