To fetch orders subcollection we will need the documentId , so to get the documentId we need to fetch the users collection to get the userId . UserCard is a widget that displays the user details and on taping it new screen is pushed that contains all the orders of that particular user.31 Eki 2020
Read moreHow do I add a Subcollection to firestore?
The solution goes: Get the interested document (doc) and then: doc. ref. collection(‘Collection_Name’). add(‘Object_to_be_added’) It is advisable to include a then/catch after the promise.
Read moreHow do I use firestore with flutter?
Firestore Tutorial for Flutter: Getting Started
Read moreWhat is Subcollection in firebase?
A subcollection is a collection associated with a specific document . Note: You can query across subcollections with the same collection ID by using Collection Group Queries. You can create a subcollection called messages for every room document in your rooms collection: collections_bookmark rooms. class roomA.
Read more