I am currently working on the chat aspect of my app. and I set up an AnimatedList inside of a StreamBuilder in order to make the messages appear in reverse. This is my code
children: <Widget>[
new Flexible(
child: new StreamBuilder<QuerySnapshot> (
stream: chatRoomRef.document(widget.chatRoomID).collection('messages')
.orderBy('time').snapshots(),
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot){
return new AnimatedList(
reverse: true,
padding: const EdgeInsets.all(8.0),
itemBuilder: (BuildContext context, int index, Animation<double> animation) {
return new ChatMessageListItem(
context: context,
index: index,
animation: animation,
reference: snapshot,
);
}
);
},
),
),
My problem is that the builder is never hit, so the AnimatedList is never called. I am not sure the setup is correct so any help on this is much appreciated.
Edit: I am trying to make it work like the FirebaseAnimatedList widget. I dont know if that helps with understanding my goal here.
Thank you