stop method
void
stop()
Stops the periodic synchronization timer.
This method:
- Cancels the periodic sync timer
- Reports disconnected state to the client
- Stops any ongoing sync (waits for current cycle to complete)
Usage:
periodicStrategy.stop(); // Stop syncing
Behavior:
- Idempotent: calling multiple times has no effect if already stopped
- Does not clear pending events: they remain in local storage
- Current sync cycle completes before stopping
After stopping, you can restart with start.
Implementation
void stop() {
LocalFirstLogger.log('Stopping periodic sync strategy', name: logTag);
_isRunning = false;
_syncTimer?.cancel();
_syncTimer = null;
reportConnectionState(false);
}