fetchBlockIds method

Future<List<String>> fetchBlockIds()

Gets the block ids from the server.

Return The block ids obtained from the server.

Throws A description of the exception. See ChatError.

Implementation

Future<List<String>> fetchBlockIds() async {
  try {
    Map result = await platform_interface.Client.instance.contactManager
        .callNativeMethod(ChatMethodKeys.getBlockListFromServer);
    ChatError.hasErrorFromResult(result);
    List<String> list = [];
    result[ChatMethodKeys.getBlockListFromServer]?.forEach((element) {
      if (element is String) {
        list.add(element);
      }
    });
    return list;
  } catch (e) {
    rethrow;
  }
}