根据您的用例,您可能不需要RxDart来执行此操作。如果您只想将两个Firestore流合并到一个Dart中
Stream,则可以
StreamZip从
dart:async包中使用。
import 'dart:async';Stream<List<QuerySnapshot>> getData() { Stream stream1 = Firestore.instance.collection('test').where('type', isEqualTo: 'type1').snapshots(); Stream stream2 = Firestore.instance.collection('test').where('type', isEqualTo: 'type2').snapshots(); return StreamZip([stream1, stream2]).asBroadcastStream();}


