getConversationList method

  1. @override
Future<Map<String, dynamic>> getConversationList({
  1. String? nextSeq,
  2. int count = 50,
})
override

Implementation

@override
Future<Map<String, dynamic>> getConversationList({ String? nextSeq, int count = 50 }) async {
  if (ImState.chatInstance.value != null) {
    V2TimValueCallback<V2TimConversationResult> convList = await TencentImSDKPlugin.v2TIMManager.getConversationManager().getConversationList(nextSeq: nextSeq ?? '0', count: count);
    if (convList.code == 0) {
      return convList.data!.toJson();
    } else {
      developerLog('获取会话列表失败, ${convList.code} | ${convList.desc}');
      throw Exception('获取会话列表失败, ${convList.code} | ${convList.desc}');
    }
  } else {
    developerLog('sdk 未初始化');
    throw Exception('sdk 未初始化');
  }
}