delete static method

Future<void> delete({
  1. required String containerId,
  2. required String relativePath,
})

Delete a file from iCloud container directory, whether it is been downloaded or not

containerId is the iCloud Container Id.

relativePath is the relative path of the file on iCloud, such as file1 or folder/file2

PlatformException with code PlatformExceptionCode.fileNotFound will be thrown if the file does not exist

Implementation

static Future<void> delete({
  required String containerId,
  required String relativePath,
}) async {
  if (!_validateRelativePath(relativePath)) {
    throw InvalidArgumentException('invalid relativePath');
  }

  await ICloudStoragePlatform.instance.delete(
    containerId: containerId,
    relativePath: relativePath,
  );
}