Resource<T> class

Constructors

Resource({ResourceStatus status = ResourceStatus.ERROR, T? data, String? message, int? code, dynamic exception, dynamic extras})
Resource.error(T? data, String? message, {int? code, dynamic exception, dynamic extras})
factory
Resource.loading(T? data, {dynamic extras})
factory
Resource.success(T? data, {dynamic extras})
factory

Properties

code int?
getter/setter pair
data ↔ T?
getter/setter pair
exception ↔ dynamic
getter/setter pair
extras ↔ dynamic
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
isError bool
no setter
isLoading bool
no setter
isSuccess bool
no setter
isTransient bool
no setter
message String?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status ResourceStatus
getter/setter pair

Methods

clone({required Resource<T> currentData, Resource<T>? newData, bool merge = false}) Resource<T>
exists() bool
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.
override

Static Methods

hasData(Resource? resource) bool