UFileStorage class abstract

Constructors

UFileStorage()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

backend → UStorageBackend
no setter
cacheMaxBytes ↔ int
Upper bound for the cache bucket. Least recently used entries go first.
getter/setter pair
changes → Stream<UStorageEvent>
Emits whenever an entry is written or removed, so storage UIs can refresh.
no setter
hasFileSystem → bool
True when entries are real files (not IndexedDB records) that can be opened by path.
no setter
isVaultAvailable → bool
Whether the vault could be opened. False after a key-store failure at startup.
no setter
vaultKeys → Future<UVaultKeys>
no setter

Static Methods

adopt(String sourcePath, String key, {required int size, UStorageBucket bucket = UStorageBucket.support, Duration? expireIn, String? mimeType, String? sha256, Map<String, String>? tags}) → Future<void>
Takes ownership of a file that is already in bucket's format — plain bytes, or a vault file for the vault bucket — and files it under key. The download manager finishes downloads this way so they are never copied twice.
allFilesStorageInfo() → Map<String, int>
clear({UStorageBucket? bucket, bool includeDownloads = false}) → Future<void>
Clears one bucket, or every bucket when bucket is null. Partial downloads survive unless includeDownloads is true.
contains(String key, {UStorageBucket bucket = UStorageBucket.support}) → bool
copy(String from, String to, {UStorageBucket bucket = UStorageBucket.support, UStorageBucket? toBucket}) → Future<void>
copyFile(String sourceKey, String destinationKey) → Future<void>
entries({UStorageBucket? bucket}) → List<UStorageEntry>
entry(String key, {UStorageBucket bucket = UStorageBucket.support}) → UStorageEntry?
evictExpired() → Future<void>
exportFile(String key, String destinationPath, {UStorageBucket bucket = UStorageBucket.support}) → Future<bool>
Writes a plaintext copy of key to destinationPath (decrypting vault entries).
fileExists(String key) → bool
fileSize(String key) → Future<int>
flush() → Future<void>
Writes any pending index changes now. Call before the app is terminated if you have written in the last half second.
getBytes(String key, {UStorageBucket bucket = UStorageBucket.support}) → Future<Uint8List?>
getJson(String key, {UStorageBucket bucket = UStorageBucket.support}) → Future
getKeys() → Future<List<String>>
getString(String key, {UStorageBucket bucket = UStorageBucket.support}) → Future<String?>
importFile(String sourcePath, String key, {UStorageBucket bucket = UStorageBucket.support, bool deleteSource = false, String? mimeType, Map<String, String>? tags}) → Future<void>
Copies (or moves) a file from anywhere on disk into storage. Encrypts it for the vault.
init({int? cacheMaxBytes}) → Future<void>
keys({UStorageBucket bucket = UStorageBucket.support}) → List<String>
move(String from, String to, {UStorageBucket bucket = UStorageBucket.support, UStorageBucket? toBucket}) → Future<void>
partsDirectory(UStorageBucket bucket) → Future<String>
Directory for partial downloads that must survive restarts (inside bucket).
pathOf(String key, {UStorageBucket bucket = UStorageBucket.support}) → String?
The file behind key when it can be opened directly (native, non-vault). Useful for players and share sheets. Vault entries never expose a plaintext path.
read(String key, {UStorageBucket bucket = UStorageBucket.support, int start = 0, int? end}) → Stream<Uint8List>
Streams [start, end) of an entry. Vault entries decrypt only the chunks in range, which is what lets encrypted video seek.
remove(String key, {UStorageBucket bucket = UStorageBucket.support}) → Future<void>
retryVault() → Future<bool>
Retries opening a vault that was locked at startup. Returns true once it is usable.
set(String key, String value) → Future<void>
setBytes(String key, List<int> bytes, {UStorageBucket bucket = UStorageBucket.support, Duration? expireIn, String? mimeType, Map<String, String>? tags}) → Future<void>
setJson(String key, Object? value, {UStorageBucket bucket = UStorageBucket.support, Duration? expireIn}) → Future<void>
setString(String key, String value, {UStorageBucket bucket = UStorageBucket.support, Duration? expireIn}) → Future<void>
size(String key, {UStorageBucket bucket = UStorageBucket.support}) → int
storedPath(String key, {UStorageBucket bucket = UStorageBucket.support}) → String?
Where key's bytes live inside backend — the ciphertext for vault entries, an IndexedDB key on the web. For diagnostics and tests; read entries through getBytes / read.
totalStorageUsed() → int
trimCache() → Future<void>
Evicts least-recently-used cache entries until the cache fits cacheMaxBytes.
update(String key, {UStorageBucket bucket = UStorageBucket.support, Duration? expireIn, String? mimeType, Map<String, String>? tags}) → Future<void>
Updates expiry, MIME type or tags without rewriting the data.
usage({UStorageBucket? bucket}) → int
Bytes used by one bucket, or by all of them.
verify(String key, {UStorageBucket bucket = UStorageBucket.support}) → Future<bool>
Re-checks integrity: every AEAD tag for vault entries, or the stored SHA-256 otherwise.
write(String key, Stream<List<int>> data, {UStorageBucket bucket = UStorageBucket.support, Duration? expireIn, String? mimeType, Map<String, String>? tags, UHashAlgorithm? hash}) → Future<int>
Streams data into key without holding it in memory. Replaces the entry atomically.