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:

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:

Implemented types

Constructors

StreamFirebaseDataSource({required String path, T builder(Map<String, dynamic>? jsondata, String docId)?})
Creates a new instance of StreamFirebaseDataSource.

Properties

builder ↔ T Function(Map<String, dynamic>? jsondata, String docId)?
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
path ↔ String
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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