title: Flutter: Convert firestore snapshot to list in streambuilder
body: <p>I need to convert a snapshot from cloud firestore to a list, i know this is unnecessary to show the data but i need it to reorder the data based in other parameters, this is my code</p>
  <pre><code> Stream chatRooms;
    List item = [];
  
   Widget chatRoomsList() {
      return StreamBuilder(
        stream: chatRooms,
        builder: (context, snapshot) {
          if (snapshot.hasData &amp;&amp;
              !snapshot.hasError) {
            item = [];
  
            item = snapshot.data;
  
            return ListView.builder(
                itemCount: item.length,
                shrinkWrap: true,
                itemBuilder: (context, index) {
                  return ChatRoomsTile(
                    otherUserUid:item[index]['arrayUsers']
                        .replaceAll(&quot;[&quot;, &quot;&quot;)
                        .replaceAll(widget.user.uid, &quot;&quot;)
                        .replaceAll(&quot;]&quot;, &quot;&quot;)
                        .replaceAll(&quot;,&quot;, &quot;&quot;)
                        .replaceAll(&quot; &quot;, &quot;&quot;),
                    chatRoomId:
                    item[index][&quot;chatRoomId&quot;],
                    user: widget.user,
                  );
                });
          } else
              return Container();
        },
      );
    }
  
    @override
    void initState() {
      getUserInfogetChats();
      super.initState();
    }
  
    getUserInfogetChats() async {
      DatabaseMethods().getUserChats(widget.user.uid).then((snapshots) {
        setState(() {
          chatRooms = snapshots;
        });
      });
    }
  </code></pre>
  <p>and im getting this error</p>
  <pre><code>════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
  The following _TypeError was thrown building StreamBuilder&lt;dynamic&gt;(dirty, state: _StreamBuilderBaseState&lt;dynamic, AsyncSnapshot&lt;dynamic&gt;&gt;#48820):
  type 'QuerySnapshot' is not a subtype of type 'List&lt;dynamic&gt;'
  </code></pre>