fetchJoinedGroupsFromServer method Null safety
Gets all groups of the current user from the server.
This method returns a group list which does not contain member information. If you want to update information of a group to include its member information, call {@link #fetchGroupInfoFromServer(String groupId)}.
Return The list of groups that the current user joins.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<List<EMGroup>> fetchJoinedGroupsFromServer({
int pageSize = 200,
int pageNum = 1,
}) async {
Map req = {'pageSize': pageSize, 'pageNum': pageNum};
Map result = await _channel.invokeMethod(
ChatMethodKeys.getJoinedGroupsFromServer, req);
EMError.hasErrorFromResult(result);
List<EMGroup> list = [];
result[ChatMethodKeys.getJoinedGroupsFromServer]
?.forEach((element) => list.add(EMGroup.fromJson(element)));
return list;
}