Posts

Showing posts with the label real-time

Flutter: StreamBuilder uses old stream instead of new stream

Flutter: StreamBuilder uses old stream instead of new stream I'm trying to show a Google-Firestore real-time list on my Flutter app using Flutter's StreamBuilder. However, the stream seems to be using both the old data and the new data, instead of just the new one. (See below) //This is the widget with the stream Expanded( child: StreamBuilder<QuerySnapshot>( stream: _firestoreInstance.collection("seeks").document('145725').collection("classes").document(_chosenClass) .collection("classTopics").document(date).collection("dateTopics").snapshots(), builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot){ if (!snapshot.hasData) return Text('Loading...'); return ListView( children: snapshot.data.documents.map((DocumentSnapshot document){ debugPrint("DOCCUMENT ID: ${document.documentID} AND topic...