CloudSyncHelper class

Cloud synchronization helper managing offline-first sync queues with automatic retry and conflict resolution.

Constructors

CloudSyncHelper({required CloudSyncAdapter adapter, int maxRetries = 3, Duration retryDelay = const Duration(seconds: 5)})
Constructs a CloudSyncHelper.

Properties

adapter → CloudSyncAdapter
Cloud sync adapter for upload/download operations.
final
hashCode → int
The hash code for this object.
no setterinherited
isSyncing → bool
Whether a sync operation is currently running.
no setter
maxRetries → int
Maximum retry attempts for failed uploads.
final
queueLength → int
Number of items in the sync queue.
no setter
queueStats → SyncQueueStats
Current sync queue statistics.
no setter
retryDelay → Duration
Delay between retry attempts.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
syncEvents → Stream<SyncEvent>
Stream of sync events for monitoring upload progress.
no setter

Methods

clearAll() → void
Clears the entire sync queue.
clearSynced() → void
Clears all synced items from the queue.
dispose() → void
Disposes the sync helper and closes event streams.
enqueue(ScanResult result, {Map<String, String>? metadata}) → void
Enqueues a scan result for cloud synchronization.
enqueueAll(List<ScanResult> results) → void
Enqueues multiple scan results for cloud synchronization.
exportQueueState() → String
Exports the current sync queue state as JSON for persistence.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processQueue() → Future<int>
Processes the sync queue — uploads all pending items with retry logic.
retryFailed() → Future<int>
Retries all failed items in the queue.
toString() → String
A string representation of this object.
inherited

Operators

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