data_layer_firestore 0.0.1
data_layer_firestore: ^0.0.1 copied to clipboard
Provides Firestore-specific bindings for pkg:data_layer.
Data Layer Hive #
An add-on to pkg:data_layer which provides a Firestore implementation of the Source interface.
Motivation #
Seamlessly plug Cloud Firestore into your Flutter apps' data_layer repositories with the FirestoreSource class from this package.
Index #
Architecture #
pkg:data_layer_firestore provides a FirestoreSource class which implements the WatchableSource interface to seamlessly integrate Cloud Firestore into your data_layer ecosystem. This source handles all necessary translation between data_layer's request details and Firestore's querying syntax, while also supporting real-time data streaming.
Getting started #
Add the following to your pubspec.yaml:
dependencies:
data_layer: ^0.0.6
data_layer_firestore: ^0.0.1
Creating a FirestoreSource #
Instances of a FirestoreSource meant to be used within the context of a SourceList.
SourceList(
...
sources: [
LocalMemorySource(...),
FirestoreSource(
FirebaseFirestore.instance,
bindings: User.bindings,
collectionPath: 'users',
],
)