You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CloudKit has support for assets. It'd be nice to implement those into the package eventually.
However, we'd need to figure out how to implement the linking for this to work.
Two ways currently come to my mind:
Maintain the current CloudKitRecord.values structure (Map<String, dynamic>), add a new class for assets, check the values map for any CloudKitAsset values, and convert those to CKAssets on the platform side of the plugin.
Reconsider the usage of dynamic maps for values altogether and develop something that would match CloudKit's field types. While this will add some inconvenience (e.g., using CKValue.int(12) instead of 12), we'll get more safety and won't be able to use types that aren't supported by CloudKit (e.g., nested maps, which are currently allowed by the Dart API but will fail when trying to use them).
I favor the second option more, but I need some background thinking to see what works best.
I've also been thinking about code generation; not for this particular use case, but it may make syncing complex/large data easier while being the safer* way to design CloudKit models.
* I'm unsure if we can reach 100% yet; need to dig into CloudKit a little more for that
The text was updated successfully, but these errors were encountered:
f-person
changed the title
Support assets ([CKAsset](https://developer.apple.com/documentation/cloudkit/ckasset))
Support assets (CKAsset)
Sep 2, 2023
CloudKit has support for assets. It'd be nice to implement those into the package eventually.
However, we'd need to figure out how to implement the linking for this to work.
Two ways currently come to my mind:
CloudKitRecord.values
structure (Map<String, dynamic>
), add a new class for assets, check thevalues
map for anyCloudKitAsset
values, and convert those toCKAsset
s on the platform side of the plugin.CKValue.int(12)
instead of12
), we'll get more safety and won't be able to use types that aren't supported by CloudKit (e.g., nested maps, which are currently allowed by the Dart API but will fail when trying to use them).I favor the second option more, but I need some background thinking to see what works best.
I've also been thinking about code generation; not for this particular use case, but it may make syncing complex/large data easier while being the safer* way to design CloudKit models.
* I'm unsure if we can reach 100% yet; need to dig into CloudKit a little more for that
The text was updated successfully, but these errors were encountered: