getBlockListFromDB method Null safety

Future<List<String>> getBlockListFromDB()

Gets the block list from the local database.

Return The block list obtained from the local database.

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

Implementation

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