Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support assets (CKAsset) #8

Open
f-person opened this issue Sep 2, 2023 · 1 comment
Open

Support assets (CKAsset) #8

f-person opened this issue Sep 2, 2023 · 1 comment

Comments

@f-person
Copy link
Contributor

f-person commented 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:

  1. 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.
  2. 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

@f-person f-person changed the title Support assets ([CKAsset](https://developer.apple.com/documentation/cloudkit/ckasset)) Support assets (CKAsset) Sep 2, 2023
@f-person
Copy link
Contributor Author

f-person commented Sep 2, 2023

Going with the second option would also help with #2, #3 and #4 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant