leaveChatThread method

Future<void> leaveChatThread({
  1. required String chatThreadId,
})

Leave Chat Thread.

The operation is available to Chat Thread members. After leave chat thread, the multiple devices will receive the notification event. You can set {@ChatMultiDeviceEventHandler} to listen on the event. The event callback function is ChatMultiDeviceEventHandler.onChatThreadEvent, where the first parameter is the event, and chat thread exit event is ChatMultiDevicesEvent.CHAT_THREAD_LEAVE.

Param chatThreadId Chat Thread ID.

Throws A description of the exception. See ChatError.

Implementation

Future<void> leaveChatThread({
  required String chatThreadId,
}) async {
  try {
    Map req = {
      "threadId": chatThreadId,
    };
    Map result = await platform_interface.Client.instance.chatThreadManager.callNativeMethod(
      ChatMethodKeys.leaveChatThread,
      req,
    );
    ChatError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}