IndexedDbBackend class
Native stub for the web-only IndexedDB backend — constructor throws.
- Inheritance
-
- Object
- ChunkedBackend
- IndexedDbBackend
Constructors
- IndexedDbBackend({required String dbName, int chunkSize = ChunkedBackend.defaultChunkSize})
- Throws UnsupportedError: IndexedDB requires a browser.
Properties
- backing → StorageBackend
-
The backing backend — exposed for subclasses that need to add
platform-specific operations (e.g. materialize) on top.
no setterinherited
- chunkSize → int
-
Plaintext bytes per chunk record.
finalinherited
- disposeLabel → String
-
Short class name used in the post-dispose error, e.g.
'FileSystemBackend'.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
True once markDisposed has run.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkNotDisposed(
) → void -
Throws StateError when this object has been disposed. Call as the
first statement of every public method.
inherited
-
chunkKeyFor(
String key, int generation, int index) → String -
The backing-record key of chunk
indexingenerationofkey. For subclasses whose materialize reads chunk records directly — pair with manifestFor to get the current generation.inherited -
copy(
String sourceKey, String destKey) → Future< void> -
Copy an object, including its metadata.
inherited
-
delete(
String key) → Future< void> -
Delete a single object.
inherited
-
deletePrefix(
String prefix) → Future< void> -
Delete every object whose key starts with
prefix(batch delete).inherited -
dispose(
) → Future< void> -
Release the resources this backend itself constructed (database
connections, HTTP clients). Idempotent — safe to call twice. Every
method except dispose throws StateError afterwards.
override
-
exists(
String key) → Future< bool> -
Check if a key exists. Convenience for
(await head(key)) != null.inherited -
head(
String key) → Future< ObjectInfo?> -
Get object metadata without reading the body (HeadObject).
inherited
-
list(
String prefix) → Future< List< ObjectInfo> > -
List every object whose key starts with
prefix, with full metadata.inherited -
manifestFor(
String key) → Future< ChunkedManifest?> -
The manifest for
key, or null when the object doesn't exist. For subclasses whose materialize reads chunk records directly.inherited -
markDisposed(
) → void -
Record disposal. Idempotent.
inherited
-
materialize(
String key, {bool decrypt = true, bool exclusive = false}) → Future< MaterializedFile> -
Make a stored object available as a platform-local accessible resource.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String key) → Future< Uint8List> -
Read entire contents as bytes. Convenience wrapper over readStream.
inherited
-
readRange(
String key, {required int start, required int length}) → Future< Uint8List> -
Read a byte range.
inherited
-
readStream(
String key) → Stream< List< int> > -
Read as a byte stream. Primary read path.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateMetadata(
String key, {String? contentType, Map< String, String> metadata = const {}}) → Future<void> -
Update metadata for an existing object without touching its bytes.
inherited
-
write(
String key, Uint8List bytes, [WriteOptions options = const WriteOptions()]) → Future< void> -
Write bytes. Convenience wrapper over writeStream.
inherited
-
writeStream(
String key, Stream< List< byteStream, [WriteOptions options = const WriteOptions()]) → Future<int> >void> -
Write a byte stream with optional write options.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited