title: Firebase Flutter StreamBuilder when dismiss the list from listview the Screen is lagging a bit
body: <p>The link is my situation in .mp4 for 3 secs
  <a href="https://drive.google.com/file/d/1NHzRgB8OU5TzWHUpPBFC-cy0D6Zqc_3T/view?usp=sharing" rel="nofollow noreferrer">the lagging screen</a>.
  I found my screen shows some lagging situation after I dismiss the listview and update the doc.</p>
  <p>This is my dismissible widget.</p>
  <pre><code>Dismissible(
                            direction: DismissDirection.endToStart,
                            background: Container(
                              color: Colors.red,
                            ),
                            onDismissed: (DismissDirection direction) {
                              setState(
                                () {
                                  healthGoal.removeAt(index);
                                  healthgoalCollection
                                      .doc(&quot;c66ae3ef-9853-4&quot;)
                                      .update(
                                    {
                                      &quot;healthGoalList&quot;: healthGoal,
                                    },
                                  );
                                },
                              );
                            },
  </code></pre>
  <p>Here is my stream builder widget that I get the data from</p>
  <pre><code>StreamBuilder&lt;DocumentSnapshot&gt;(
        stream: _healthGoalStream,
        builder: (context, AsyncSnapshot&lt;DocumentSnapshot&gt; snapshot) {
          if (!snapshot.hasData) {
            return const Text(&quot;No data&quot;);
          }
          if (snapshot.hasError) {
            return const Center(child: Text('Something went wrong'));
          }
  
          if (snapshot.connectionState == ConnectionState.waiting) {
            return const Center(
              child: CircularProgressIndicator(
                color: Colors.red,
              ),
            );
          }
  
          if (snapshot.connectionState == ConnectionState.active) {
            Map&lt;String, dynamic&gt; condition =
                snapshot.data?.data() as Map&lt;String, dynamic&gt;;
  
            Map&lt;String, dynamic&gt; conditionmap =
                Map&lt;String, dynamic&gt;.from(condition);
            healthGoal.clear();
            conditionmap.forEach(
              (key, value) {
                if (key == &quot;healthGoalList&quot;) {
                  healthGoal = value;
                }
                if (key == &quot;nameUpdated&quot;) {
                  if (value != &quot;&quot;) {
                    nameupdate = value;
                  }
                }
                if (key == &quot;agreeToGoal&quot;) {
                  if (value != &quot;&quot;) {
                    agreeToGoal = value;
                  }
                }
  
                if (key == &quot;dateTimeUpdated&quot;) {
                  if (value != &quot;&quot;) {
                    timeget = DateTime.fromMillisecondsSinceEpoch(value);
                    timeupdate = f.format(timeget);
                  }
                }
              },
            );
  </code></pre>
  <p>Are there any ways that can prevent this kind of lagging situation? Thanks if you can help or even give me a direction on the cause.</p>
  <p>This is my cloud firestore data looks like</p>
  <p><a href="https://i.stack.imgur.com/6VJhy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6VJhy.png" alt="This is my cloud firestore data looks like" /></a></p>