updateMetadata abstract method
Update metadata for an existing object without touching its bytes.
Used after streaming writes where some metadata field (e.g. the original-plaintext size for an encrypted file) is only known once the stream completes.
- Local: rewrites the
.meta.jsonsidecar. - IndexedDB: re-reads the record and writes it back with the updated metadata fields.
- A remote store: copy-to-itself with new metadata (when it has no in-place metadata update).
Implementation
Future<void> updateMetadata(
String key, {
String? contentType,
Map<String, String> metadata = const {},
});