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

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

Remote Cache Sync for Flutter #

A Flutter/Dart toolkit for remote-first synchronization with offline cache, pending operations, conflict resolution, and scope-aware persistence.

Installing #

Use this package as an executable

  1. Install it
dart pub global activate remote_cache_sync
  1. Use it

This package exposes the following executable:

web_setup

Run from your Flutter app root to prepare Flutter Web (Drift WASM):

# Debug build to ./web
dart run remote_cache_sync:web_setup

# Or release build and custom destination
dart run remote_cache_sync:web_setup \
  --release \
  --dest /path/to/app/web \
  --wasm /absolute/path/to/sqlite3.wasm

Notes:

  • Requires dev dependencies in your app: build_runner, build_web_compilers.
  • If missing, the tool will print commands to add them.
  • Copies a compiled worker.dart.(js|min.js) and sqlite3.wasm into your web/ directory.

Use this package as a library

  1. Depend on it

With Flutter:

flutter pub add remote_cache_sync

This will add a line like this to your pubspec.yaml and run flutter pub get:

dependencies:
  remote_cache_sync: ^0.1.0
  1. Import it
import 'package:remote_cache_sync/remote_cache_sync.dart';

Quick start and API examples are available in the docs below.

Adapters import (Supabase/Appwrite/PocketBase) #

To keep the core entrypoint WASM-compatible, backend adapters are provided via a separate barrel. Import adapters only if you use them:

// Core (WASM-safe)
import 'package:remote_cache_sync/remote_cache_sync.dart';

// Backend adapters (may pull non-web-safe deps)
import 'package:remote_cache_sync/remote_cache_sync_adapters.dart';

This keeps web/wasm builds compatible when you only need the core sync APIs.

Flutter Web setup (Drift WASM quick guide) #

Most apps will only need to run the helper once:

dart run remote_cache_sync:web_setup

What it does:

  • Ensures web/worker.dart exists (creates a minimal default if missing).
  • Builds it to JS (debug or release).
  • Copies sqlite3.wasm to web/.

Common options:

dart run remote_cache_sync:web_setup --release
dart run remote_cache_sync:web_setup --dest ./example/web
dart run remote_cache_sync:web_setup --wasm ./assets/sqlite3.wasm

If you prefer a specific compiler:

dart run remote_cache_sync:web_setup --compiler dart2js
dart run remote_cache_sync:web_setup --compiler build_runner

Documentation #

Issues and feedback #

  • Please file issues/feature requests here: Issues

Contributing #

1
likes
0
points
345
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