Failure<T> class final

Class representing a failed result.

Inheritance
Annotations

Constructors

Failure(Object? error)
Creates a Failure with the given error.
const

Properties

error Object?
The exception of the Result.
final
errorOrNull Object?
Returns the exception if Result is Failure or null otherwise.
no setterinherited
getOrNull → T?
Returns the value if Result is Success or null otherwise.
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
isFailure bool
Returns true if Result is Failure.
no setterinherited
isSuccess bool
Returns true if Result is Success.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<R>(R transform(T value)) Result<R>
Maps the value of Result if it is Success or returns the same Result otherwise.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult success(T response), required TResult error(Object? error)}) → TResult
Maps the value of the result and returns the error or success TResult
inherited

Operators

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