feat: sync cloudId and eTag on sync

This commit is contained in:
shenlong-tanwen
2025-12-03 20:10:24 +05:30
parent 44b50bfa23
commit e76b6baf23
37 changed files with 9902 additions and 47 deletions

View File

@@ -0,0 +1,44 @@
enum RemoteAssetMetadataKey {
mobileApp("mobile-app");
final String key;
const RemoteAssetMetadataKey(this.key);
}
abstract class RemoteAssetMetadataValue {
const RemoteAssetMetadataValue();
Map<String, dynamic> toJson();
}
class RemoteAssetMetadataItem {
final RemoteAssetMetadataKey key;
final RemoteAssetMetadataValue value;
const RemoteAssetMetadataItem({required this.key, required this.value});
Map<String, Object?> toJson() {
return {'key': key.key, 'value': value};
}
}
class RemoteAssetMobileAppMetadata extends RemoteAssetMetadataValue {
final String? cloudId;
final String? eTag;
const RemoteAssetMobileAppMetadata({this.cloudId, this.eTag});
@override
Map<String, dynamic> toJson() {
final map = <String, Object?>{};
if (cloudId != null) {
map["iCloudId"] = cloudId;
}
if (eTag != null) {
map["eTag"] = eTag;
}
return map;
}
}