getGroupFileListFromServer method Null safety

  1. @Deprecated("Switch to using fetchGroupFileListFromServer instead.")
Future<List<EMGroupSharedFile>> getGroupFileListFromServer(
  1. String groupId,
  2. {int pageSize = 200,
  3. int pageNum = 1}
)
@Deprecated("Switch to using fetchGroupFileListFromServer instead.")

Gets the shared files of the group from the server.

Param groupId The group ID.

Param pageSize The number of shared files per page.

Param pageNum The page number, starting from 1.

Return The shared files.

Throws A description of the exception. See {@link EMError}.

Implementation

@Deprecated("Switch to using fetchGroupFileListFromServer instead.")
Future<List<EMGroupSharedFile>> getGroupFileListFromServer(
  String groupId, {
  int pageSize = 200,
  int pageNum = 1,
}) async {
  Map req = {'groupId': groupId, 'pageNum': pageNum, 'pageSize': pageSize};
  Map result = await _channel.invokeMethod(
      ChatMethodKeys.getGroupFileListFromServer, req);
  try {
    EMError.hasErrorFromResult(result);
    List<EMGroupSharedFile> list = [];
    result[ChatMethodKeys.getGroupFileListFromServer]?.forEach((element) {
      list.add(EMGroupSharedFile.fromJson(element));
    });
    return list;
  } on EMError catch (e) {
    throw e;
  }
}