flutter_local_first 0.1.0
flutter_local_first: ^0.1.0 copied to clipboard
A local-first sync engine for Flutter and Dart: offline-first writes, a durable outbox, tombstones, pluggable conflict resolution and attachment syncing — with no backend or database lock-in.
Changelog #
0.1.0 #
Initial release.
Added #
LocalFirstSyncengine with a push/pull/resolve cycle, periodic syncing, reconnect syncing, debounced write-triggered syncing and shared in-flight cycles.LocalStorecontract plusInMemoryLocalStore, including a guard that stops a concurrent local edit from being marked synced by a push already in flight.RemoteStorecontract plusInMemoryRemoteStorewith latency, fault injection and pagination.BatchRemoteStorefor backends that can fetch records by id in one round trip, making conflict detection a single request.- Tombstone support: deletions travel as records with
deletedAt, with a configurable TTL before purge. - Conflict resolution:
lastWriteWins,remoteWins,localWins,manual, and custom field-level resolvers that take precedence over the policy. RetryPolicywith exponential backoff, jitter, a delay ceiling and retry-by-error-type.- Attachment syncing:
AttachmentQueuewith concurrency limits, per-file retry, progress events and cascading deletes when a record is removed. - Connectivity abstraction with
Stream,Manual,ProbeandAlwaysOnlineimplementations. - Observability: a
ValueListenable<SyncState>and a stream of nine typedSyncEvents. - 152 tests covering conflict policies, backoff, both in-memory adapters, the attachment queue and end-to-end engine behaviour including two-device convergence.