fetchChatThread method
- required String chatThreadId,
~english Get Chat Thread details from server.
Param chatThreadId
Chat Thread ID.
Return The chat thread object.
Throws A description of the exception. See ChatError. ~end
~chinese 从服务器获取子区详情。
Param chatThreadId
子区 ID。
Return 若调用成功,返回子区详情;失败则抛出异常。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。 ~end
Implementation
Future<ChatThread?> fetchChatThread({
required String chatThreadId,
}) async {
Map req = {"threadId": chatThreadId};
Map result = await _channel.invokeMethod(
ChatMethodKeys.fetchChatThreadDetail,
req,
);
try {
ChatError.hasErrorFromResult(result);
return ChatThread.fromJson(result[ChatMethodKeys.fetchChatThreadDetail]);
} on ChatError catch (e) {
throw e;
}
}