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
-
downloadAsset(
{required CloudKitRecordId id, required String field, required File destination, void onProgress(double fraction)?}) → Future< void> -
Writes the asset in
fieldof the recordidtodestination, replacing any file there. Adestinationthat is a directory fails with CloudKitSyncException.invalidArgument.onProgressreceives 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
idexists 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
sourceas the asset infieldof the recordid, creating the zone when needed. The saved record holds only that asset and replaces any existing recordid.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited