CloudKitAssetStore class final

Moves single assets to and from the CloudKit private database, outside CloudKitSyncEngine.

Use it for large files that devices download only on demand, kept in a zone the engine excludes. Requires iOS 17 or macOS 14.

Constructors

CloudKitAssetStore(String containerId)
Creates a CloudKitAssetStore for containerId.
const

Properties

containerId → String
CloudKit container identifier.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteRecord(CloudKitRecordId id) → Future<void>
Deletes the record id. A record or zone that does not exist counts as deleted.
downloadAsset({required CloudKitRecordId id, required String field, required File destination, void onProgress(double fraction)?}) → Future<void>
Writes the asset in field of the record id to destination, replacing any file there. A destination that is a directory fails with CloudKitSyncException.invalidArgument. onProgress receives the fraction of the download completed, from 0 to 1.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordExists(CloudKitRecordId id) → Future<bool>
Whether the record id exists on the server. A missing zone counts as a missing record.
toString() → String
A string representation of this object.
inherited
uploadAsset({required CloudKitRecordId id, required String recordType, required String field, required File source}) → Future<void>
Saves source as the asset in field of the record id, creating the zone when needed. The saved record holds only that asset and replaces any existing record id.

Operators

operator ==(Object other) → bool
The equality operator.
inherited