getMuteListFromServer method Null safety

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

Gets the mute list of the group from the server.

Only the group owner or admin can call this method.

Param groupId The group ID.

Param pageSize The number of muted members per page.

Param pageNum The page number, starting from 1.

Return The group mute list.

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

Implementation

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