getBlockListFromServer method

  1. @Deprecated('Use fetchBlockIds instead.')
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 ChatError.

Implementation

@Deprecated('Use fetchBlockIds instead.')
/// Gets the block list from the server.
///
/// **Return** The block list obtained from the server.
///
/// **Throws** A description of the exception. See [ChatError].
Future<List<String>> getBlockListFromServer() async {
  Map result = await _channel.invokeMethod(
    ChatMethodKeys.getBlockListFromServer,
  );
  try {
    ChatError.hasErrorFromResult(result);
    List<String> list = [];
    result[ChatMethodKeys.getBlockListFromServer]?.forEach((element) {
      if (element is String) {
        list.add(element);
      }
    });
    return list;
  } on ChatError catch (e) {
    throw e;
  }
}