syncNow static method
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:
- Push all pending local changes to the backend
- Pull all remote changes from the backend
- 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();
}