streamData method

  1. @override
Stream<List<T>> streamData()
override

Streams a list of data items from Firebase Firestore.

This method returns a stream of data items of type T from the specified Firestore collection path. The data is built using the provided builder function.

Returns:

  • A Stream of List of T containing the streamed data items.

Implementation

@override
Stream<List<T>> streamData() async* {

  var varbuilder = builder ??
      (json, docId) => BaseEntityDataModel.fromJson(json ?? {}, docId) as T;

  var dataResult = _fireStore.streamAllData(
    path: path,
    builder: (data, documentId) => varbuilder(data, documentId),
  );
  yield* dataResult!;
}