I am trying to use
StreamBuilder<QuerySnapshot>( stream: _firestore.collection('messages').snapshots(), builder: (context,snapshot){ if(snapshot.hasData) { final messages = snapshot.data.docs; List<Text> messageWidgets=[]; for(var message in messages){ final messageText=message.data['text']; final messageSender=message.data['sender']; final messageWidget= Text('$messageText from $messageSender'); messageWidgets.add(messageWidget); } } }, ), I am getting error in final messageText=message.data['text']; final messageSender=message.data['sender']; I know it may be because of the new update but I want to access it and in documentation could not find anything like this.
In database in document I have two fields sender and text that is what I want to get individually out of data in messageText and messageSender. also please suggest some source where I could read so that next time I would not need to ask such question.