Result<T> class sealed

Implementers

Constructors

Result.failure([Object? failure, StackTrace? stackTrace])
Creates a Failure result.
const
factory
Result.success(T value)
Creates a Success result.
const
factory

Properties

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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

guard<T>(T f()) Result<T>
Wraps a function call in a try-catch block. Returns a Success result if the function call succeeds. Returns a Failure result if the function call throws.