title: Flutter: AnimatedSwitcher inside StreamBuilder
body: <p>Im trying to implement an AnimatedSwitcher in my app to animate a chat that uses firebase as backend, i already seen various examples but when i try to send new messages in the chat the animation doesn't work, this is my code:</p>
  <pre><code>return StreamBuilder(
        stream: _chats,
        builder: (context, snapshot) {
          if (snapshot.hasData &amp;&amp;
              !snapshot.hasError &amp;&amp;
              snapshot.data.snapshot.value != null) {
            item = [];
            Map data = snapshot.data.snapshot.value;
            data.forEach((index, data) =&gt; item.add({
                  &quot;key&quot;: index,
                  &quot;message&quot;: data['message'],
                  &quot;sendBy&quot;: data['sendBy'],
                  &quot;time&quot;: data['time']
                }));
            item.sort((b, a) =&gt; a[&quot;time&quot;].compareTo(b[&quot;time&quot;]));
            return AnimatedSwitcher(
              duration: Duration(milliseconds: 500),
              child: ListView.builder(
                  reverse: true,
                  controller: _scrollController,
                  itemCount: item.length,
                  itemBuilder: (context, index) {
                    return MessageTile(
                        message: item[index]['message'],
                        sendByMe: widget.user.uid == item[index]['sendBy'],
                        time: item[index]['time']);
                  }),
            );
          } else {
            return Container();
          }
        },
      );
  </code></pre>