【发布时间】:2022-01-10 12:15:31
【问题描述】:
当 Firebase 中不存在搜索结果时,我试图向我的用户显示一条消息“用户不存在”。
这是我的代码,但我不知道如何设置它的条件:
onPressed: () {
FirebaseFirestore.instance
.collection('Users')
.doc('list_students')
.collection('Students')
..where('Email',
isEqualTo: emailcontroller.text)
.get()
.then((QuerySnapshot querySnapshot) {
querySnapshot.docs.forEach((doc) {
addStudentToSec(
widget.courseId!,
widget.sectionId!,
emailcontroller.text,
getName(doc.data() as Map));
});
【问题讨论】:
标签: firebase flutter dart google-cloud-firestore