AsyncCallStatusInterceptor class
A singleton service that manages and broadcasts updates to the current PagifyAsyncCallStatus.
This class is used by Pagify to keep track of and notify listeners when the API call status changes.
Constructors
- AsyncCallStatusInterceptor.new()
- Creates a new AsyncCallStatusInterceptor and initializes it.
Properties
- currentState ↔ PagifyAsyncCallStatus
-
The current async call status.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastStateBeforeNetworkError ↔ PagifyAsyncCallStatus
-
The last status before a network error occurred.
getter/setter pair
-
listenStatusChanges
→ Stream<
PagifyAsyncCallStatus> -
Alias for stream, used for semantic clarity.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
PagifyAsyncCallStatus> -
Returns the broadcast stream of status changes.
no setter
Methods
-
dispose(
) → void - Closes the stream and resets the singleton instance.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setLastStatusAsCurrent(
{required Future< void> ifLastIsLoading()}) → void - Restores the last status before network error as the current status.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateAllStatues(
PagifyAsyncCallStatus newStatus) → void - Updates both the current and last statuses.
-
updateStatus(
PagifyAsyncCallStatus newStatus) → void - Updates the current status and notifies listeners.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited