getConversation static method

Future<V2TimValueCallback<V2TimConversation>> getConversation({
  1. required String conversationID,
})

Implementation

static Future<V2TimValueCallback<V2TimConversation>> getConversation({
  /*required*/ required String conversationID,
}) async {
  V2TimValueCallback<List<V2TimConversation>> list = await IMNative.getConversationListByConversaionIds(conversationIDList: [Tools.nativecidtoCcid(conversationID)]);

  if (list.code == 0) {
    if (list.data!.isNotEmpty) {
      return V2TimValueCallback<V2TimConversation>.fromJson({"code": 0, "desc": "", "data": list.data![0].toJson()});
    } else {
      return V2TimValueCallback<V2TimConversation>.fromJson({"code": 0, "desc": "", "data": null});
    }
  } else {
    return V2TimValueCallback<V2TimConversation>.fromJson({"code": list.code, "desc": list.desc, "data": null});
  }
}