skip to Main Content

Get DocumentSnapshot by its id from Firebase collection

I'm trying to get DocumentSnapshot from collection this my code Stream<QuerySnapshot> streamState() => collectionRef.snapshots(); return StreamBuilder<QuerySnapshot>( stream: auth.streamState(), builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot){ if (snapshot.hasData){ DocumentSnapshot doc = snapshot.data!.docs.elementAt(0); print(doc.id); } return Container( color: Colors.white, ); } ); it work…

VIEW QUESTION
Back To Top
Search