dart_data_firebase 0.1.1
dart_data_firebase: ^0.1.1 copied to clipboard
Firebase Firestore backend adapter for dart_data. Syncs your offline-first local database with Firestore via the REST API. No Firebase SDK dependency.
dart_data_firebase #
Firebase Firestore backend adapter for dart_data — the SwiftData for Flutter.
Sync your offline-first local database with Firebase Firestore via the REST API. No Firebase SDK dependency — works on every Dart platform.
Installation #
dependencies:
dart_data: ^0.1.0
dart_data_firebase: ^0.1.0
Usage #
import 'package:dart_data/dart_data.dart';
import 'package:dart_data_firebase/dart_data_firebase.dart';
final adapter = FirebaseAdapter(projectId: 'my-project');
await adapter.initialize(BackendConfig(
url: 'https://firestore.googleapis.com',
));
final syncEngine = SyncEngine(
adapter: adapter,
queue: OperationQueue(storage: sqliteStorage),
statusNotifier: SyncStatusNotifier(),
modelTypes: ['Todo'],
);
await syncEngine.sync();
Features #
- Firestore REST API — No native SDK needed. Pure Dart HTTP client.
- Document mapping — Automatically converts between Dart maps and Firestore's typed-value format.
- Firebase Auth — Built-in REST authentication support.
- 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.