LocusSync class
Sync operations.
Constructors
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
- hasSyncBodyBuilder → bool
-
Whether a sync body builder (foreground or headless) is available.
no setter
Static Methods
-
buildSyncBody(
List< Location> locations, JsonMap extras) → Future<JsonMap?> - Builds the sync body using the registered callback. Returns null if no builder is registered.
-
clearQueue(
) → Future< void> - Clears all queued payloads.
-
clearSyncBodyBuilder(
) → void - Clears the sync body builder callback.
-
destroyLocations(
) → Future< bool> - Destroys all stored locations.
-
enqueue(
JsonMap payload, {String? type, String? idempotencyKey}) → Future< String> - Enqueues a custom payload for offline-first delivery.
-
getQueue(
{int? limit}) → Future< List< QueueItem> > - Returns queued payloads.
-
registerHeadlessSyncBodyBuilder(
Future< JsonMap> builder(SyncBodyContext context)) → Future<bool> - Registers a headless-compatible sync body builder.
-
resumeSync(
) → Future< bool> - Resumes syncing after a pause (e.g., token refresh).
-
setSyncBodyBuilder(
SyncBodyBuilder? builder) → void - Sets a callback to build custom HTTP sync body.
-
sync(
) → Future< bool> - Triggers an immediate sync of pending locations.
-
syncQueue(
{int? limit}) → Future< int> - Attempts to sync queued payloads immediately.