I'm developing a password manager app using flutter and firebase as a backend service and database. I have a database with a collection of users, and inside users there is a subcollection named passwordProfiles that have a number of documents inside it.
Using listview.build I managed to fetch all the documents inside that subcollection. Now I want to only fetch a 1 specific document inside the subcollection. How can I achieve that?
Below is the link to my github repo: https://github.com/Tron987/prog.git
From your pubspec.yaml
file I see you use Firestore as your database backend instead of Realtime Database which can be confused as both are Firebase products.
To query a single document you need to use DocumentSnapshot
return from Firestore . Here is the complete Firestore query documentation which details how to get values from Collections full of documents or just a single Document with it's ID or it's values.
As you are just trying to get a single document this is the exact part that you must check.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.