updateMetadata abstract method

Future<void> updateMetadata(
  1. String key, {
  2. String? contentType,
  3. Map<String, String> metadata = const {},
})

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.json sidecar.
  • 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 {},
});