getConversation method
Future<EMConversation?>
getConversation(
- String conversationId, [
- EMConversationType type = EMConversationType.Chat,
- bool createIfNeed = true
通过会话id
, 会话类型type
获取会话.
Implementation
Future<EMConversation?> getConversation(
String conversationId, [
EMConversationType type = EMConversationType.Chat,
bool createIfNeed = true,
]) async {
Map req = {
"con_id": conversationId,
"type": EMConversation.typeToInt(type),
"createIfNeed": createIfNeed
};
Map result = await _channel.invokeMethod(EMSDKMethod.getConversation, req);
EMError.hasErrorFromResult(result);
EMConversation? ret;
if (result[EMSDKMethod.getConversation] != null) {
ret = EMConversation.fromJson(result[EMSDKMethod.getConversation]);
}
return ret;
}