srollToNewMessage method
Implementation
void srollToNewMessage({bool scrollToEnd = true}) {
if (hasMoreNewerMessages) {
_messageList.clear();
showNewMessage = true;
newMessages.clear();
_initFetch(scrollToBottom: true);
return;
}
if (newMessages.isNotEmpty) {
_messageList.insertAll(0, newMessages);
newMessages.clear();
}
showNewMessage = true;
if (scrollToEnd) {
_scrollToEnd?.call();
}
notifyListeners();
}