fromConversation static method
Future<ConversationItemModel>
fromConversation(
- Conversation conversation,
- ChatUIKitProfile profile
Implementation
static Future<ConversationItemModel> fromConversation(
Conversation conversation,
ChatUIKitProfile profile,
) async {
int unreadCount = await conversation.unreadCount();
Message? lastMessage = await conversation.latestMessage();
bool noDisturb =
ChatUIKitContext.instance.conversationIsMute(conversation.id);
ConversationItemModel info = ConversationItemModel(
profile: profile,
unreadCount: unreadCount,
lastMessage: lastMessage,
pinned: conversation.isPinned,
noDisturb: noDisturb,
hasMention: conversation.ext?[hasMentionKey] == hasMentionValue,
attributes: conversation.ext,
);
return info;
}