我正在尝试 waitUser(array) 检查存在值我该怎么做?
// 如果waitUser 数组字段存在2 return text("this text") else return text("other text")
body: StreamBuilder(
stream: FirebaseFirestore.instance
.collection('events')
.where('eventCity', isEqualTo: 'Ankara')
.snapshots(),
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
if (!snapshot.hasData) {
// ERROR
return Center(
child: CircularProgressIndicator(),
);
} else {
return Container(
child: ListView(
scrollDirection: Axis.vertical,
children: snapshot.data.docs.map((document) {
// if waitUser array field exist 2 return text("this text") else return text("other text")
}).toList(),
),
);
}
},
),