SyncServiceImpl class

Implementation of SyncService using method channel.

Implemented types

Constructors

SyncServiceImpl(LocusInterface _instanceProvider())
Creates a sync service with the given Locus interface provider.

Properties

connectivityEvents Stream<ConnectivityChangeEvent>
Stream of connectivity changes.
no setteroverride
events Stream<HttpEvent>
Stream of HTTP sync events.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearHeadersCallback() → void
Clears the dynamic headers callback.
override
clearQueue() Future<void>
Clears all queued payloads.
override
clearSyncBodyBuilder() → void
Clears the sync body builder callback.
override
enqueue(JsonMap payload, {String? type, String? idempotencyKey}) Future<String>
Enqueues a custom payload for offline-first delivery.
override
evaluatePolicy({required SyncPolicy policy}) Future<SyncDecision>
Evaluates if sync should proceed based on current conditions.
override
getQueue({int? limit}) Future<List<QueueItem>>
Returns queued payloads.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
now() Future<bool>
Triggers an immediate sync of pending locations.
override
onConnectivityChange(void callback(ConnectivityChangeEvent), {Function? onError}) StreamSubscription<ConnectivityChangeEvent>
Subscribes to connectivity change events.
override
onHttp(void callback(HttpEvent), {Function? onError}) StreamSubscription<HttpEvent>
Subscribes to HTTP sync events.
override
refreshHeaders() Future<void>
Manually triggers a header update.
override
registerHeadlessSyncBodyBuilder(Future<JsonMap> builder(SyncBodyContext context)) Future<bool>
Registers a headless-compatible sync body builder.
override
resume() Future<bool>
Resumes sync after a pause (e.g., after token refresh).
override
setHeadersCallback(Future<Map<String, String>> callback()?) → void
Sets a callback to provide dynamic HTTP headers.
override
setPolicy(SyncPolicy policy) Future<void>
Sets the sync policy.
override
setSyncBodyBuilder(SyncBodyBuilder? builder) → void
Sets a callback to build custom HTTP sync body.
override
syncQueue({int? limit}) Future<int>
Attempts to sync queued payloads immediately.
override
toString() String
A string representation of this object.
inherited

Operators

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