I'm creating a chat, and the problem is that, for example, when there is a video or voice message in the messages, then when insert completely rebuilds everything and fails to watch or listen to the message if the person writes. How to make sure that not everything is rebuilt.
I read that if the key is the same, then this element will not be rebuilt, but I still have it rebuilt. As a key, I give the time of the message.
PagewiseListView<MessageData>(
reverse: true,
shrinkWrap: true,
cacheExtent: 6500,
controller: _scrollController,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(top:10.0, left: 8, right: 8,bottom: getHeight(70)),
loadingBuilder: (c) => LoaderPage()
addAutomaticKeepAlives: true,
itemBuilder: (c,message,index) => UserMessage(data: message, index: index, toUserID: widget.toUserid, player: mPlayer, key: message.key),
showRetry: true,
pageLoadController: pageLoadControllerMessage,
),