pinConversation method

Future<void> pinConversation(
  1. {required String conversationId,
  2. required bool isPinned}
)

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 {
  Map map = {
    'convId': conversationId,
    'isPinned': isPinned,
  };

  Map result = await ChatChannel.invokeMethod(
    ChatMethodKeys.pinConversation,
    map,
  );
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}