I have been able to query a data in a subcollecion directly using collectiongroup with the following code in flutter:
What I have tried:
final uid = FirebaseAuth.instance.currentUser!.uid;
QueryDocumentSnapshot<map<string, dynamic="">>? selectedRide;
StreamBuilder(
stream: FirebaseFirestore.instance
.collectionGroup('Requests')
.snapshots(),
builder: (BuildContext context,
AsyncSnapshot<querysnapshot<map<string, dynamic="">>> snapshot)
{ final request = snapshot.data!;
return ListView.builder(
itemCount: snapshot.data!.docs.length,
itemBuilder: (context, index) return Card(
onTap: () {} ////update data onTap of this list view.
//Let's say the data is : request.docs[index].get('Full Name')
How do I update it?
)})
)