loadMessageWithAnchor method
void
loadMessageWithAnchor(
- NIMMessage anchor
Implementation
void loadMessageWithAnchor(NIMMessage anchor) {
_logI('initFetch -->> anchor:${anchor.text}');
// Historical navigation positions the list away from the latest message.
// Keep later messages in the pending list so the user gets the new-message
// prompt instead of being scrolled away from the selected message.
prepareForAnchorLoading();
hasMoreForwardMessages = true;
hasMoreNewerMessages = true;
if (ChatKitUtils.isDesktopOrWeb) {
// 设置锚点时间,触发消息列表的 _scrollToMessageByTime 定位
findAnchorDate = anchor.createTime?.toInt();
}
_fetchMessageListBothDirect(anchor);
}