getConversationTitle static method
Gets the conversation title (user name or group name).
Returns the name of the user or group that the conversation is with. Returns empty string if the conversation participant is not found.
Implementation
static String getConversationTitle(Conversation conversation) {
if (conversation.conversationWith is User) {
return (conversation.conversationWith as User).name;
} else if (conversation.conversationWith is Group) {
return (conversation.conversationWith as Group).name;
}
return '';
}