fetchWhiteListFromServer method Null safety

Future<List<String>?> fetchWhiteListFromServer(
  1. String groupId
)

Gets the allow list of the group from the server.

Only the group owner or admin can call this method.

Param groupId The group ID.

Return The allow list of the group.

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

Implementation

Future<List<String>?> fetchWhiteListFromServer(String groupId) async {
  Map req = {'groupId': groupId};
  Map result = await _channel.invokeMethod(
      ChatMethodKeys.getGroupWhiteListFromServer, req);
  try {
    EMError.hasErrorFromResult(result);
    return result[ChatMethodKeys.getGroupWhiteListFromServer]?.cast<String>();
  } on EMError catch (e) {
    throw e;
  }
}