title: How to calculate the sum of a particular field of all the documents in a collection in Firestore | Dart
body: <pre><code> return  Container(
          height: 70,
          width: 100,
          color: Colors.white,
          child: StreamBuilder(
              stream: testRef
                  .snapshots(),
              builder: (context, snapshot) {
                if (snapshot.connectionState == ConnectionState.waiting) {
                      return CircularProgressIndicator();
                }
  
                      return Row(
                          children: &lt;Widget&gt;[
                            Padding(
                              padding: const EdgeInsets.all(15.0),
                              child: Text(
                                &quot;Total is : &quot;,
                              ),
                            ),
                            Text(
                               &quot; &quot; , )
                          ]);
              }));
  </code></pre>
  <p>Here is a picture of the Firestore documents
  <a href="https://i.stack.imgur.com/0zJ0m.png" rel="nofollow noreferrer">First Document variable</a>
  <a href="https://i.stack.imgur.com/8iR1T.png" rel="nofollow noreferrer">Second Document variable</a></p>
  <p>How can I calculate the sum of the two variables and display it in a Text widget</p>