且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Flutter:如何在Firestore中获取集合的所有文档名称

更新时间:2023-02-14 08:08:40

您可以通过获取以下文档列表来做到这一点:

You can do that by getting list of documents like:

final QuerySnapshot result =
          await Firestore.instance.collection('myCollection').getDocuments();
final List<DocumentSnapshot> documents = result.documents;

然后您可以遍历此列表并获取数据:

And after that you can iterate this list and get data:

documents.forEach((data) => print(data));