remote_cache_sync 0.1.4 copy "remote_cache_sync: ^0.1.4" to clipboard
remote_cache_sync: ^0.1.4 copied to clipboard

Remote cache synchronization toolkit for Flutter with Appwrite, PocketBase, and Supabase adapters.

Remote Cache Sync for Flutter #

Remote Cache Sync lets you manage remote data via a single cache-first query API. You do not need to call remote backends directly; the orchestrator keeps your local cache synchronized and evaluates your queries consistently offline and online.

Orchestrator-first Quickstart #

final orchestrator = SimpleSyncOrchestrator<Todo, String>(
  local: DriftLocalStore<Todo, String>(/* ... */),
  remote: SupabaseRemoteStore<Todo, String>(/* ... */),
  resolver: const LastWriteWinsResolver<Todo>(),
  idOf: (t) => t.id,
);

final scope = const SyncScope('todos', {'userId': 'u1'});

final items = await orchestrator.readWith(
  scope,
  QuerySpec(
    filters: [
      FilterOp(field: 'updatedAt', op: FilterOperator.gte, value: DateTime.utc(2025, 1, 1)),
    ],
    orderBy: [OrderSpec('updatedAt', descending: true)],
    limit: 20,
  ),
  policy: CachePolicy.remoteFirst,       // sync then evaluate on local cache
  preferRemoteEval: false,               // set true to try remote-side filtering first
  fallbackToLocal: true,                 // fall back when remote can't support a filter
);

Key benefits:

  • Orchestrator-driven single entrypoint for reads/writes
  • Cache-consistent query evaluation with QuerySpec
  • Seamless offline/online via CachePolicy
  • Pluggable remotes (Appwrite, PocketBase, Supabase) and local stores (Drift)

Documentation #

Issues and feedback #

  • File issues/feature requests: Issues

Contributing #

2
likes
0
points
145
downloads

Publisher

unverified uploader

Weekly Downloads

Remote cache synchronization toolkit for Flutter with Appwrite, PocketBase, and Supabase adapters.

Homepage
Repository (GitHub)
View/report issues

Topics

#cache #sync #drift #wasm #flutter-web

Documentation

Documentation

License

unknown (license)

Dependencies

appwrite, drift, drift_flutter, flutter, path_provider, plugin_platform_interface, pocketbase, supabase_flutter

More

Packages that depend on remote_cache_sync