StaleMateRefreshResult<T> class
The result of a refresh operation
This class is used to return the result of a refresh operation
It contains information about the success of the refresh operation along with properties thatn can be used to debug the refresh operation
The StaleMateRefreshResult.on method is a useful utility method that can be used to simplify handling the result of a refresh operation
Constructors
- StaleMateRefreshResult({required StaleMateRefreshStatus status, required DateTime refreshInitiatedAt, required DateTime refreshFinishedAt, T? refreshedData, Object? error})
- Constructs a StaleMateRefreshResult
- StaleMateRefreshResult.alreadyRefreshing({required DateTime refreshInitiatedAt, required DateTime refreshFinishedAt})
-
Shorthand for StaleMateRefreshStatus.alreadyRefreshing
factory
- StaleMateRefreshResult.failure({required DateTime refreshInitiatedAt, required DateTime refreshFinishedAt, required Object error})
-
Shorthand for StaleMateRefreshStatus.failure
factory
- StaleMateRefreshResult.success({required T data, required DateTime refreshInitiatedAt, required DateTime refreshFinishedAt})
-
Shorthand for StaleMateRefreshStatus.success
factory
Properties
- error → Object?
-
The error if the refresh failed
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAlreadyRefreshing → bool
-
Whether a refresh is already in progress
no setter
- isFailure → bool
-
Whether the refresh failed
no setter
- isSuccess → bool
-
Whether the refresh was successful
no setter
- refreshDuration → Duration
-
The duration of the refresh operation
no setter
- refreshedData → T?
-
The refreshed data if the refresh was successful
final
- refreshFinishedAt → DateTime
-
The duration of the refresh operation
final
- refreshInitiatedAt → DateTime
-
The time at which the refresh was initiated
final
- requireData → T
-
The refreshed data if the refresh was successful
no setter
- requireError → Object
-
The error if the refresh failed
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → StaleMateRefreshStatus
-
The status of the refresh operation
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on(
{dynamic success(T data)?, dynamic failure(Object error)?}) → dynamic - Utility method to simplify handling the result of a refresh operation
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited