title: snapshot.data.docs.length not working on flutter
body: <p>I make some listview and it have likes and comments section. I want to show how many likes and comments that post had. The like section works by displaying the number of users who like it, i try to show it with <code>snapshot.data.docs.length.toString()</code> from firestore but when i try to show how many comments with same code as like section it not working and only get 0.</p>
  <p>this is inside comments field
  <a href="https://i.stack.imgur.com/UG8Cm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UG8Cm.png" alt="this is inside my firestore, comments field" /></a></p>
  <pre><code>Padding(
      padding: const EdgeInsets.only(top: 8),
      child: Padding(
        padding: const EdgeInsets.only(left: 15),
        child: Row(
          mainAxisAlignment:
              MainAxisAlignment.spaceEvenly,
          children: [
            Container(
              width: 80.0,
              child: Row(
                mainAxisAlignment:
                    MainAxisAlignment.start,
                children: [
                  GestureDetector(
                    onLongPress: () {
                      Provider.of&lt;PostFunction&gt;(context,
                              listen: false)
                          .showLikes(
                              context,
                              documentSnapshot
                                  .data()['title']);
                    },
                    onTap: () {
                      print('Adding like...');
                      Provider.of&lt;PostFunction&gt;(context,
                              listen: false)
                          .addLike(
                              context,
                              documentSnapshot
                                  .data()['title'],
                              Provider.of&lt;AuthenticationService&gt;(
                                      context,
                                      listen: false)
                                  .getUserUid);
                    },
                    child: Icon(
                      FontAwesomeIcons.arrowAltCircleUp,
                      color: kGreyColor,
                      size: 18.0,
                    ),
                  ),
                  StreamBuilder&lt;QuerySnapshot&gt;(
                      stream: FirebaseFirestore.instance
                          .collection('posts')
                          .doc(documentSnapshot
                              .data()['title'])
                          .collection('likes')
                          .snapshots(),
                      builder: (context, snapshot) {
                        if (snapshot.connectionState ==
                            ConnectionState.waiting) {
                          return Center(
                              child:
                                  CircularProgressIndicator());
                        } else {
                          return Padding(
                            padding:
                                const EdgeInsets.only(
                                    left: 8.0),
                            child: RichText(
                              text: TextSpan(
                                  text: snapshot
                                      .data.docs.length
                                      .toString(),
                                  style: GoogleFonts
                                      .openSans(
                                          color:
                                              kGreyColor,
                                          fontSize: 16.0),
                                  children: &lt;TextSpan&gt;[
                                    TextSpan(
                                        text: ' votes',
                                        style: GoogleFonts
                                            .openSans(
                                          color:
                                              kGreyColor,
                                          fontSize: 16.0,
                                        )),
                                  ]),
                            ),
                          );
                        }
                      })
                ],
              ),
            ),
            SizedBox(width: 20),
            Container(
              width: 150.0,
              child: Row(
                mainAxisAlignment:
                    MainAxisAlignment.start,
                children: [
                  GestureDetector(
                    onTap: () {
                      Provider.of&lt;PostFunction&gt;(context,
                              listen: false)
                          .showComments(
                              context,
                              documentSnapshot,
                              documentSnapshot
                                  .data()['title']);
                    },
                    child: Icon(
                      FontAwesomeIcons.solidComments,
                      color: kGreyColor,
                      size: 16.0,
                    ),
                  ),
                  StreamBuilder&lt;QuerySnapshot&gt;(
                      stream: FirebaseFirestore.instance
                          .collection(' posts')
                          .doc(documentSnapshot
                              .data()['title'])
                          .collection('comments')
                          .snapshots(),
                      builder: (context, snapshot) {
                        if (snapshot.connectionState ==
                            ConnectionState.waiting) {
                          return Center(
                              child:
                                  CircularProgressIndicator());
                        } else {
                          return Padding(
                            padding:
                                const EdgeInsets.only(
                                    left: 8.0),
                            child: Text(
                              snapshot.data.docs.length
                                  .toString(),
                              style: GoogleFonts.openSans(
                                  color: kGreyColor,
                                  fontSize: 16.0),
                            ),
                          );
                        }
                      }),
                ],
              ),
            ),
            Spacer(),
            Provider.of&lt;AuthenticationService&gt;(context,
                            listen: false)
                        .getUserUid ==
                    documentSnapshot.data()['useruid']
                ? IconButton(
                    icon: Icon(EvaIcons.moreVertical,
                        color: kGreyColor, size: 16),
                    onPressed: () {
                      Provider.of&lt;PostFunction&gt;(context,
                              listen: false)
                          .showPostOptions(
                              context,
                              documentSnapshot
                                  .data()['title']);
                    })
                : Container(width: 0.0, height: 0.0)
          ],
        ),
      ),
    ),
  </code></pre>