pinConversation method
Sets whether to pin a conversation.
Param conversationId The conversation ID.
Param isPinned Whether to pin a conversation:
- true: Pin the conversation.
- false: Unpin the conversation.
Throws A description of the exception. See ChatError.
Implementation
Future<void> pinConversation(
{required String conversationId, required bool isPinned}) async {
try {
Map map = {
'convId': conversationId,
'isPinned': isPinned,
};
Map result = await platform_interface.Client.instance.chatManager.callNativeMethod(
ChatMethodKeys.pinConversation,
map,
);
ChatError.hasErrorFromResult(result);
} catch (e) {
rethrow;
}
}