IndexedDbFileSystem class

A file system storing files divided into blocks in an IndexedDB database.

As sqlite3's file system is synchronous and IndexedDB isn't, no guarantees on durability can be made. Instead, file changes are written at some point after the database is changed. However you can wait for changes manually with flush

In the future, we may want to store individual blocks instead.

Implemented types

Properties

files List<String>
Lists all files stored in this file system.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isClosed bool
Whether this file system is closing or closed.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() Future<void>
Deletes all files stored in this file system.
override
close() Future<void>
createFile(String path, {bool errorIfNotExists = false, bool errorIfAlreadyExists = false}) → void
Creates an empty file at path.
override
createTemporaryFile() String
Creates a temporary file with a unique name.
override
deleteFile(String path) → void
Deletes a file at path if it exists, throwing a FileSystemException otherwise.
override
exists(String path) bool
Whether a file at path exists.
override
flush() Future<void>
Waits for all pending operations to finish, then completes the future.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String path, Uint8List target, int offset) int
Reads a chunk of the file at path and offset offset into the target buffer.
override
sizeOfFile(String path) int
Returns the size of a file at path if it exists.
override
toString() String
A string representation of this object.
inherited
truncateFile(String path, int length) → void
Sets the size of the file at path to length.
override
write(String path, Uint8List bytes, int offset) → void
Writes a chunk from bytes into the file at path path and offset offset.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

databases() Future<List<String>?>
Returns all IndexedDB database names accessible from the current context.
deleteDatabase([String dbName = 'sqlite3_databases']) Future<void>
Deletes an IndexedDB database.
open({required String dbName}) Future<IndexedDbFileSystem>
Loads an IndexedDB file system identified by the dbName.