Failure<ResultType> class abstract

Inheritance

Constructors

Failure(AppError error)
const
factory

Properties

asFailure Failure<AppError>
Cast this into a Failure, and throw an exception if the cast fails! It might be tempting to just cast the result into the desired type, but it's strongly advised to not do that. Although, it might be convenient to have this cast sometimes. Use it wisely!
no setterinherited
asSuccess Success<ResultType>
Cast this into a Success, and throw an exception if the cast fails! It might be tempting to just cast the result into the desired type, but it's strongly advised to not do that. Although, it might be convenient to have this cast sometimes. Use it wisely!
no setterinherited
copyWith → _$$FailureImplCopyWith<ResultType, _$FailureImpl<ResultType>>
no setter
error AppError
no setter
hashCode int
The hash code for this object.
no setterinherited
isFailure bool
no setterinherited
isSuccess bool
no setterinherited
maybeData Maybe<ResultType>
Getter that results in a Just if the Result is Success and Nothing othterwise
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

handle<T>({required T onSuccess(ResultType data), required T onFailure(AppError error)}) → T
the handle method which has two required parameters an onSuccess callback
inherited
mapAsyncSuccess<K>(FutureOr<Result<K>> combiner(ResultType)) FutureOr<Result<K>>
A method to chain asynchronous access to data held by the Result. If this is Failure returns [FutureOr<Failure>], if this is Success, returns the result of the combiner method over the data inside Success
inherited
mapSuccess<K>(Result<K> combiner(ResultType)) Result<K>
A method used to chain access to data held by the Result. If this is Failure returns Failure, if this is Success, returns the result of the combiner method over the data inside Success
inherited
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