简体   繁体   English

当我按下某个按钮时,如何从 firebase 中检索文档?

[英]How can i retrieve documents from the firebase when i press on a certain button?

I'm new to flutter development so this might be basic knowledge to you.我是 flutter 开发的新手,所以这可能是您的基本知识。 I have this application where I need the user to choose a retrieved tags from the database when they post我有这个应用程序,我需要用户在发布时从数据库中选择检索到的标签

this is the tags I want to list them to the users where they can checkbox their desired tags firebase collections这是我想将它们列出给用户的标签,他们可以在其中勾选他们想要的标签

I tried to watch videos and read docs but there is always an error and I don't know what is the right way to do it我尝试观看视频和阅读文档,但总是出现错误,我不知道正确的方法是什么

You can get all documents in a collection by calling FirebaseFirestore.instance.collection(YOUR_ID).snapshots()您可以通过调用FirebaseFirestore.instance.collection(YOUR_ID).snapshots()来获取集合中的所有文档

It will return a List of QuerySnapshots from which you can access the docs and their data.它将返回一个 QuerySnapshot 列表,您可以从中访问文档及其数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检索作为文档放置在 Firebase Cloud Firestore 中的 UID - How do I retrieve the UID's that I have placed as documents in my Firebase Cloud Firestore firebase 查询如何从子项中检索两个特定值 - firebase query how can i retrieve two specific values from child 如何在 Firebase 中检索数据并使用列表视图显示? - How can I retrieve data in Firebase and display with listview? 如何通过 flutter 中的文档从 firebase 存储中检索数据? - How do i retrieve data from firebase store by document in flutter? 如何从 Firebase 检索嵌套的 object? - how do i retrieve a nested object from Firebase? 如何从 firebase 结构而不是 Boolean 值中检索字段? - How can i retrieve the fields from the firebase structure instead of the Boolean values? 如何使用 firebase 数据库存储和检索数组值? - How can i stored and retrieve an array value using firebase database? 如何计算 swift 中 firestore 查询的文档数? - How can I count the documents from a firestore query in swift? 如何从 Firebase 中删除记录? - How I can Delete Record from Firebase? 当我按下“继续”按钮时应用程序崩溃(在活动之间转换) - App crashes when I press "continue" button (transitioning between activities)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM