So, i have a document id as you seen enter image description here
and i want to get data from firebase according to document id.
i dont know how can i do that.
My firebase path is also like this:
final CollectionReference productCollection = FirebaseFirestore.instance
.collection('product')
.doc('$newRoomname')
.collection('roomName');
Also i getting data like this
StreamBuilder(
stream: _databaseService.productCollection.orderBy(docID).snapshots(),
builder:
(BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(
valueColor:
new AlwaysStoppedAnimation<Color>(Colorsx.mainColor),
),
);
}
return Column(
children: snapshot.data.docs.map((documentSnapshot) {
return Column(
children: [
Container(
height: context.dynamicHeight(0.2),
child: Center(
child: Lottie.asset('assets/images/4.json'))),
LabelText(documentSnapshot["productStatus"] ?? ""),
],
);
}).toList(),
);
},
),
it's not working. is there any solution to this? i couldn't find :/