I have this piece of code, I want to return a stream of documentshapshots.
/* Get Firestore products docs
*/
Stream<List<DocumentSnapshot>> fetchFirstProductListStream() {
....
return getFirestoreUserStream(loggedInUser.uid).map((UserModel rad) =>
(geo
.collection(collectionRef: collectionReference)
.within(center: center, radius: rad.radius, field: field)) as List<DocumentSnapshot>
);
}
I do get the following error as I try to cast the return value to List.
> [VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: type
> '_AsBroadcastStream<List<DocumentSnapshot>>' is not a subtype of type > > 'List<DocumentSnapshot>'