getBlockListFromServer method Null safety

Future<List<String>> getBlockListFromServer()

Gets the block list from the server.

Return The block list obtained from the server.

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

Implementation

Future<List<String>> getBlockListFromServer() async {
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.getBlockListFromServer);
  try {
    EMError.hasErrorFromResult(result);
    List<String> blockList = [];
    result[ChatMethodKeys.getBlockListFromServer]?.forEach((element) {
      blockList.add(element);
    });
    return blockList;
  } on EMError catch (e) {
    throw e;
  }
}