getJoinedGroups method
获取本地缓存中当前用户的所有群组信息。
Return 群组列表。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError.
Implementation
Future<List<ChatGroup>> getJoinedGroups() async {
try {
Map result = await platform_interface.Client.instance.groupManager
.callNativeMethod(ChatMethodKeys.getJoinedGroups);
ChatError.hasErrorFromResult(result);
List<ChatGroup> list = [];
result[ChatMethodKeys.getJoinedGroups]
?.forEach((element) => list.add(ChatGroup.fromJson(element)));
return list;
} catch (e) {
rethrow;
}
}