firebase 无法将元素类型“Stream< dynamic>”分配给列表类型“Stream〈Query Snapshot〈Object?>>"

mklgxw1f  于 2023-01-02  发布在  其他
关注(0)|答案(1)|浏览(94)
Stream<List<QuerySnapshot>> getData() {
Stream stream1 = FirebaseFirestore.instance.collection('Gib Role').where('id', isEqualTo: 'false').orderBy('timestamp').snapshots();
Stream stream2 = FirebaseFirestore.instance.collection('Register').where('id', isEqualTo: 'true').orderBy('timestamp').snapshots();
return StreamZip([stream1,stream2]); }

以上错误在流1和流2上可见,如何清除此错误,请任何人帮助我

trnvg8h3

trnvg8h31#

试试这个:

Stream<List<QuerySnapshot<Object?>>> getData() {
Stream<QuerySnapshot<Object?>> stream1 = FirebaseFirestore.instance.collection('Gib Role').where('id', isEqualTo: 'false').orderBy('timestamp').snapshots();
Stream<QuerySnapshot<Object?>> stream2 = FirebaseFirestore.instance.collection('Register').where('id', isEqualTo: 'true').orderBy('timestamp').snapshots();
return StreamZip([stream1,stream2]); }

相关问题