Resource<T> class sealed

Implementers
Available extensions

Constructors

Resource.empty()
const
factory
Resource.error({T? data, required Exception failure})
const
factory
Resource.loading()
const
factory
Resource.success(T data)
const
factory

Properties

data → T?
final
failure Exception?
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status Status
final

Methods

fold({required void onSuccess(T), required void onError(Exception), void onLoading()?}) → void

Available on Resource<T>, provided by the ResourceExtension extension

mapSuccess<R>(R block(T)) Resource<R>

Available on Resource<T>, provided by the ResourceExtension extension

match<R>({required R onSuccess(T), required R onError(Exception), required R onLoading(Resource<T>), required R onEmpty()}) → R

Available on Resource<T>, provided by the ResourceExtension extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onSuccess(void block(T)) → void

Available on Resource<T>, provided by the ResourceExtension extension

toString() String
A string representation of this object.
inherited

Operators

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