getConversationList static method
Future<V2TimValueCallback<V2TimConversationResult>>
getConversationList(
{ - required String nextSeq,
- required int count,
})
Implementation
static Future<V2TimValueCallback<V2TimConversationResult>> getConversationList({
required String nextSeq,
required int count,
}) async {
String userData = Tools.generateUserData();
Pointer<Uint8> user_data = Tools.string2PointerInt8(userData);
Pointer<Uint8> filter = Tools.string2PointerInt8(json.encode(Map.from({
"conversation_list_filter_conv_type": null,
"conversation_list_filter_conversation_group": null,
"conversation_list_filter_mark_type": 0,
})));
int res = desktopSDK.D_TIMConvGetConversationListByFilter(filter, int.parse(nextSeq), count, user_data);
if (res != TIMResult.TIM_SUCC) {
return V2TimValueCallback<V2TimConversationResult>.fromJson({
"code": res,
"desc": "",
});
} else {
Map<String, dynamic> data = await getAsyncData(apiKey: userData);
Map<String, dynamic> dataList = Map<String, dynamic>.from(json.decode(
data["json_param"].isEmpty ? json.encode({}) : data["json_param"],
));
List<V2TimConversation> convlist = List<V2TimConversation>.empty(growable: true);
for (var element in dataList["conversation_list_result_conv_list"]) {
Map<String, dynamic> jso = element;
V2TimConversation converInfo = await Tools.convertConvInfo2Dart(jso);
convlist.add(converInfo);
}
// 获取群和个人的信息
;
return V2TimValueCallback<V2TimConversationResult>.fromJson({
"code": data["code"],
"desc": data["desc"],
"data": {
"nextSeq": dataList["conversation_list_result_next_seq"].toString(),
"isFinished": dataList["conversation_list_result_is_finished"],
"conversationList": await addConversationBaseInfoFromGroupAndUseraInfo(convlist),
}
});
}
}