UStorage class abstract final

Static entry point. Everything not store-specific delegates to the default store.

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

changes → Stream<UStorageChange>
no setter
instance → UStore
The default store.
no setter
isReady → bool
no setter
keys → Iterable<String>
no setter
secure → UStore
Encrypted store for tokens, keys and other secrets.
no setter
secureKeys → Set<String>
Keys that ULocalStorage always keeps in secure (auth tokens).
no setter

Static Methods

clear() → Future<void>
deleteStore(String name, {bool secure = false}) → Future<void>
Closes store name and deletes its file.
flushAll() → Future<void>
Writes every pending change of every open store to disk.
get<T>(String key) → T?
getEnum<T extends Enum>(String key, List<T> values) → T?
getObject<T>(String key, T fromJson(Map<String, dynamic> json)) → T?
getObjects<T>(String key, T fromJson(Map<String, dynamic> json)) → List<T>?
getOr<T>(String key, T fallback) → T
has(String key) → bool
increment(String key, {int by = 1}) → int
init() → Future<void>
Opens the default and the secure store. Idempotent and cheap to call again; initU() calls it for you.
listenable<T>(String key) → ValueListenable<T?>
open(String name, {bool secure = false}) → Future<UStore>
Opens (or returns the already open) store name. Each store is its own file, so it can be cleared or deleted without touching the others. Use secure for encrypted stores.
remove(String key) → Future<void>
removeAll(Iterable<String> keys) → Future<void>
set(String key, Object? value, {Duration? ttl}) → Future<void>
setAll(Map<String, Object?> entries, {Duration? ttl}) → Future<void>
store(String name) → UStore
A store already opened with open.
toMap() → Map<String, Object>
ttlOf(String key) → Duration?
watch<T>(String key, {bool emitCurrent = true}) → Stream<T?>

Constants

defaultStoreName → const String
secureStoreName → const String