宣告 List 時,要指定資料型態為 <Stream<QuerySnapshot<Map>>>,才能避免發生錯誤。
List<Stream<QuerySnapshot<Map>>> stream = [
db.collection('XXX').where('XXX', isEqualTo: XXX).snapshots(),
db.collection('XXX').where('XXX', isEqualTo: XXX).snapshots(),
];StreamBuilder(
stream: stream[index],
builder: (context, snapshot) {
...
},
),