title: How to get subcollection data from firebase?
body: <p>Im trying to calculating some data together . What I have is a videos collection and then each video has a doc id and and then some field for example the uid of the user that uploads this video. And also every video has a sub collection named uservotes. Inside their I saved user voting of this video. This is how It looks</p>
  <p><a href="https://i.stack.imgur.com/0sOtX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0sOtX.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/ZleDO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZleDO.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/01OrK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/01OrK.png" alt="enter image description here" /></a></p>
  <p>And what I want is getting of one user the user votes rating field calculating together .
  HERes how I get for one video the rating maybe that will help to understand</p>
  <pre><code>FutureBuilder(
                                        future: firebase,
                                        builder:
                                            (BuildContext context, snapshot) {
                                          if (snapshot.connectionState ==
                                              ConnectionState.waiting) {
                                            return Center(
                                                child: Text(&quot;loading...&quot;));
                                          } else {
                                            double summe = 0.0;
                                            final docs = snapshot.data.docs;
  
                                            for (int i = 0;
                                                i &lt; docs.length;
                                                i++) {
                                              summe += (docs[i]['rating']);
                                              print(summe);
                                            }
                                            final possiblestars = docs.length * 5;
                                            print(possiblestars);
  
                                            return Text(
                                              &quot;${summe.toInt()}/${possiblestars}&quot;,
                                              style: TextStyle(
                                                  color: Colors.white,
                                                  fontWeight: FontWeight.bold,
                                                  fontSize: 18),
                                            );
                                          }
                                        }),
  </code></pre>
  <p>The firebase stream is this one</p>
  <pre><code>   var firebase = FirebaseFirestore.instance
                        .collection('videos')
                        .doc(videos.data()['id'])
                        .collection('uservotes')
                        .get();
  </code></pre>
  <p>So instead of getting all user votes of one video I wanna get all uservotes  of all videos form the same user. You can see that each video in  videos collection has uid field and thats the uid of the user that upload the video I can get the current user id with that</p>
  <pre><code>  final uid=   FirebaseAuth.instance.currentUser.uid;
  </code></pre>
  <p>And every video that has saved this uid as uid value Iinside field &quot;uid&quot; in videoscollction  is one off the videos that I needed
  .  Then I wanna get of  each video the sub collection  uservotes all rating to calculating they together . Dont get confused about the same uid doc inside user votes collection thats because the user that uploads this current video also rate his own video .
  Hope anyone can help .</p>