StreamFirebaseDataSource<T extends BaseEntityDataModel> class
A data source class for streaming data from Firebase Firestore.
This class implements the IBaseStream interface to provide a stream of data
from a specified Firestore collection path. It uses a builder function to
convert JSON data into a data model of type T.
Type Parameters:
T: The type of the data model, which must extend BaseEntityDataModel.
Example usage:
final streamSource = StreamFirebaseDataSource<BaseDataModel>(
path: 'collectionPath',
builder: (json, docId) => BaseDataModel.fromJson(json, docId),
);
streamSource.streamData().listen((dataList) {
// Handle the streamed data list
});
See also:
- FirebaseLoadingData, which provides methods for loading data from Firestore.
- BaseEntityDataModel, the base class for data models.
- Implemented types
Constructors
-
StreamFirebaseDataSource({required String path, T builder(Map<
String, dynamic> ? jsondata, String docId)?}) - Creates a new instance of StreamFirebaseDataSource.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
streamData(
) → Stream< List< T> > -
Streams a list of data items from Firebase Firestore.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited