OfflineQueue class

The main entry point for the Offline Queue system.

Use this class to initialize the system and queue your networking requests.

Constructors

OfflineQueue()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Properties

pendingCount Future<int>
Returns the current number of pending requests in the queue.
no setter
progressStream Stream<double>
A stream of the synchronization progress (from 0.0 to 1.0).
no setter
statusStream Stream<QueueStatus>
A stream of the current worker status (QueueStatus).
no setter

Static Methods

clear() Future<void>
Clears all pending requests from the queue.
delete(String url, {dynamic body, Map<String, String>? headers, Map<String, String>? queryParameters, OfflinePriority priority = OfflinePriority.normal}) Future<void>
Queues a DELETE request.
get(String url, {Map<String, String>? headers, Map<String, String>? queryParameters, OfflinePriority priority = OfflinePriority.normal}) Future<void>
Queues a GET request.
init({required String baseUrl, QueueStorage? storage, RetryPolicy retryPolicy = const RetryPolicy(), AuthHeaderProvider? authHeaderProvider, OnTokenExpired? onTokenExpired, bool debug = false}) Future<void>
Initialize the Offline Queue.
patch(String url, {dynamic body, Map<String, String>? headers, Map<String, String>? queryParameters, OfflinePriority priority = OfflinePriority.normal}) Future<void>
Queues a PATCH request.
pause() → void
Pauses the synchronization worker.
post(String url, {dynamic body, Map<String, String>? headers, Map<String, String>? queryParameters, OfflinePriority priority = OfflinePriority.normal, bool isMultipart = false, List<String>? filePaths}) Future<void>
Queues a POST request.
put(String url, {dynamic body, Map<String, String>? headers, Map<String, String>? queryParameters, OfflinePriority priority = OfflinePriority.normal}) Future<void>
Queues a PUT request.
resume() → void
Resumes the synchronization worker.
sync() Future<void>
Manually triggers a synchronization of the queue.