I have a array here and I want to check If in that array I have more that 1 string or not as describe in code:
bool? checkEmpty1 = false;
StreamBuilder<DocumentSnapshot<Map<String, dynamic>>>(
stream: FirebaseFirestore.instance
.collection('groups')
.doc(groupId)
.snapshots(),
builder: (context, snapshot2) {
snapshot2.data?.data()?.forEach((key, value) {
if (key == 'members') {
checkEmpty1 = value == '';
}
});
//I want to do like If members is more than 1 show this If members == to 1 show this
return checkEmpty1!
? const Text('Has one members')
: const Text('Has more than one members')
