Closed fatesinger closed 1 week ago
Hi, set count to a smaller value. For example, 50, 100.
Now the count is 40. I changed the count to 20, but the problem still remains.
final pageSize = 20;
void onLoading() async {
late List<ConversationInfo> list;
try {
list = await _request(this.list.length);
this.list.addAll(list);
} finally {
if (list.isEmpty || list.length < pageSize) {
refreshController.loadNoData();
} else {
refreshController.loadComplete();
}
}
}
_request(int offset) =>
OpenIM.iMManager.conversationManager.getConversationListSplit(
offset: offset,
count: pageSize,
);
The function reporting the error is "getFriendList".
Please try this code.
List list = [];
final pageSize = 50;
getConversationList(int offset) async {
var list = await OpenIM.iMManager.conversationManager.getConversationListSplit(
offset: offset,
count: pageSize,
);
return list;
}
FloatingActionButton(
onPressed: () async {
var result = await getConversationList(400);
setState(() {
list = result;
});
},
)
Let’s follow up on this issue.
Describe the bug
When there is too much conversation messages, calling conversationManager.getConversationListSplit will report an error.
How to reproduce
Steps to reproduce the behavior:
Use open-im-flutter-demo
Expected behavior
Conversation messages are loaded correctly
Screenshots (If contains)
Version information
Additional context