dart_data_supabase 0.1.1
dart_data_supabase: ^0.1.1 copied to clipboard
Supabase backend adapter for dart_data. Syncs your offline-first local database with Supabase using PostgREST, Realtime subscriptions, and GoTrue authentication.
dart_data_supabase #
Supabase backend adapter for dart_data — the SwiftData for Flutter.
Sync your offline-first local database with Supabase. Uses PostgREST for CRUD, Realtime for live subscriptions, and GoTrue for authentication.
Installation #
dependencies:
dart_data: ^0.1.0
dart_data_supabase: ^0.1.0
Usage #
import 'package:dart_data/dart_data.dart';
import 'package:dart_data_supabase/dart_data_supabase.dart';
final adapter = SupabaseAdapter(supabaseUrl: 'https://xyz.supabase.co');
await adapter.initialize(BackendConfig(
headers: {'apikey': 'your-anon-key'},
));
final syncEngine = SyncEngine(
adapter: adapter,
queue: OperationQueue(storage: sqliteStorage),
statusNotifier: SyncStatusNotifier(),
modelTypes: ['Todo'],
);
await syncEngine.sync();
Features #
- PostgREST — CRUD operations via Supabase's auto-generated REST API.
- Realtime — Optional live subscriptions for instant remote change notifications.
- GoTrue Auth — Built-in authentication with Supabase's auth service.
- Push & pull — Full bidirectional sync with dart_data's operation queue.
Learn More #
See the dart_data documentation for full framework docs.
License #
BSD 3-Clause. See LICENSE.