【发布时间】:2021-07-12 02:48:45
【问题描述】:
我有这段代码,我想返回一个文档快照流。
/* 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>
);
}
当我尝试将返回值转换为 List 时,我确实收到了以下错误。
> [VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: type
> '_AsBroadcastStream<List<DocumentSnapshot>>' is not a subtype of type > > 'List<DocumentSnapshot>'
【问题讨论】: