getJoinedGroupsFromServer method Null safety

  1. @Deprecated("Switch to using fetchJoinedGroupsFromServer instead.")
Future<List<EMGroup>> getJoinedGroupsFromServer(
  1. {int pageSize = 200,
  2. int pageNum = 1}
)
@Deprecated("Switch to using fetchJoinedGroupsFromServer instead.")

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

@Deprecated("Switch to using fetchJoinedGroupsFromServer instead.")
Future<List<EMGroup>> getJoinedGroupsFromServer({
  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;
}