streamAllData<T> method

Stream<List<T>>? streamAllData<T>({
  1. required String path,
  2. required T builder(
    1. Map<String, dynamic>? jsondata,
    2. String docId
    ),
})

Streams all data from the specified path and returns it as a Stream<List<T>>.

path - The path to the data. builder - The function to build the data.

Implementation

Stream<List<T>>? streamAllData<T>({
  required String path,
  required T Function(Map<String, dynamic>? jsondata, String docId) builder,
}) async* {
  yield* _fireStore.collection(path).snapshots().map((snamp) {
    return snamp.docs.map((d) {
      return builder(d.data(), d.id);
    }).toList();
  });
}