You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// ChatMessage is a class made with my personal code
/// Just to show the abstract
Future<void> fetchOlderMessages_fromServer(
{required int limit, required int pageKey}) async {
print("fetch messages (server): $limit");
try {
var fetchedMessages = await widget.chatID.messagesCollectionRef
.orderBy("time", descending: true)
.startAfter(
[Timestamp.fromDate(_getOldestMessageTime() ?? DateTime.now())])
.limit(limit)
.get();
List<ChatMessage> messages = [];
fetchedMessages.docs.forEach((element) {
messages
.add(ChatMessage.fromMap(data: element.data(), docID: element.id));
});
pagingController.appendPage(messages, pageKey + messages.length);
if (fetchedMessages.docs.isEmpty) {
pagingController.appendLastPage([]);
}
} catch (e) {
print("error: $e");
}
}
The text was updated successfully, but these errors were encountered:
Every time
.appendPage()
is called, jank happens for some reasonAppending 10 "messages" (which are widgets) at once: https://vimeo.com/744686389
Appending 1 message at once: https://vimeo.com/744686802
Appending 3 messages at once, no animation: https://vimeo.com/744686878
You can see the screen being shaky every time
pagingController
seems to call thepageRequestListener
My code looks like this:
The text was updated successfully, but these errors were encountered: