destroyChatThread method Null safety
- {required String chatThreadId}
Disband Chat Thread.
Group owner and group administrator to which the Chat Thread belongs have permission. After chat thread is disbanded, there will be the following notification:
- Members of the organization (group) to which chat thread belongs will receive the disbanded notification event, and can listen to related events by setting {@link ChatThreadManagerListener}. The event callback function is {@link ChatThreadManagerListener#onChatThreadDestroyed(ChatThreadEvent)} .
- Multiple devices will receive the notification event and you can set {@link ChatMultiDeviceListener} to listen on the event. The event callback function is {@link ChatMultiDeviceListener#onChatThreadEvent(int, String, List)}, where the first parameter is the event, for example, {@link com.hyphenate.ChatMultiDeviceListener#ChatMultiDevicesEvent.CHAT_THREAD_DESTROY} for the chat thread destruction event.
Param chatThreadId Chat Thread ID.
Throws A description of the exception. See {@link ChatError}.
Implementation
Future<void> destroyChatThread({
required String chatThreadId,
}) async {
Map req = {
"threadId": chatThreadId,
};
Map result = await _channel.invokeMethod(
ChatMethodKeys.destroyChatThread,
req,
);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}