leaveChatThread method Null safety
- {required String chatThreadId}
Leave Chat Thread.
The operation is available to Chat Thread members. After joining chat thread, the multiple devices will receive the notification event. You can set {@EMMultiDeviceListener} to listen on the event. The event callback function is {@link EMMultiDeviceListener#onChatThreadEvent(int, String, List), where the first parameter is the event, and chat thread exit event is {@link EMMultiDeviceListener#EMMultiDevicesEvent.CHAT_THREAD_LEAVE}.
Param chatThreadId
Chat Thread ID.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<void> leaveChatThread({
required String chatThreadId,
}) async {
Map req = {
"threadId": chatThreadId,
};
Map result = await _channel.invokeMethod(
ChatMethodKeys.leaveChatThread,
req,
);
try {
EMError.hasErrorFromResult(result);
} on EMError catch (e) {
throw e;
}
}