Skip to content
pubscout

sync_pilot

0.1.2, released 14 days ago by robiulsuny.com

Database-agnostic, offline-first sync engine for Dart and Flutter

WASM-ready
$ flutter pub add sync_pilot
Source repository

What it does

sync_pilot orchestrates optimistic local CRUD, outbox compaction, temporary ID mapping, 3‑way conflict resolution, and delta sync between any local store and any backend. It emits reactive streams for UI updates.

AI-written summary of version 0.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need offline-first sync without locking into a specific database or backend
  • You want automatic outbox compaction and temporary ID handling
  • You need field‑level conflict resolution and delta pagination

Skip it when

  • You only need simple local persistence
  • You already use a dedicated backend sync solution like Firebase Realtime Database or Supabase's built‑in sync

Strengths

  • Zero external runtime dependencies
  • Supports any local store (SQLite, Drift, Hive, SharedPreferences, in‑memory) and any backend (REST, GraphQL, gRPC, Firebase, Supabase, etc.)
  • Built‑in optimistic CRUD, outbox compaction, and temporary ID mapping
  • Field‑level 3‑way merge and delta sync

Weaknesses

  • No built‑in UI widgets or form helpers
  • Requires manual configuration of adapters for each storage/transport
  • Learning curve for setting up conflict resolvers and adapters

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
0

Add sync_pilot to pubspec, create SyncPilotEngine with localStore and remoteAdapter, implement ConflictResolver, no build_runner needed

```dart
final engine = SyncPilotEngine<Todo>(
  entityName: 'todos',
  getId: (t) => t.id,
  toJson: (t) => t.toJson(),
  fromJson: Todo.fromJson,
  localStore: InMemorySyncStore<Todo>(getId: (t) => t.id),
  conflictResolver: ConflictResolver<Todo>.fieldLevelMerge(
    fromJson: Todo.fromJson,
  ),
  remoteAdapter: CallbackRemoteSyncAdapter<Todo>(
    onPush: (op) async => const PushOperationResult.success(),
    onPullDelta: (cp) async => const RemoteDeltaPage<Todo>(
      upserted: [],
      deletedIds: [],
      nextCheckpoint: '2026-11-07T12:00:00Z',
      hasMore: false,
    ),
  ),
);
```

Alternatives

Packages that do the same job and could replace sync_pilot.