Please extend the existing 'delete' method so that an empty directory can also be deleted. An exception is currently thrown because a file is expected as relativePath.
Perhaps add a new parameter 'isDirectory' like this:
await icloudSyncPlugin.delete(
containerId: containerId,
relativePath: relativePath,
isDirectory: true,
);