syncNow static method

Future<void> syncNow()

Triggers an immediate synchronization with the backend.

This bypasses the automatic sync interval and forces a sync to happen right now. Useful for "pull to refresh" functionality or when you want to ensure data is synced immediately.

The sync will:

  1. Push all pending local changes to the backend
  2. Pull all remote changes from the backend
  3. Resolve any conflicts using the configured strategy

Example:

// User pulls to refresh
await SyncLayer.syncNow();

Implementation

static Future<void> syncNow() async {
  await SyncLayerCore.instance.syncEngine.syncNow();
}