SmartLocalStorage class

Entry point: open named boxes to store lists of records (with ids) on disk - plain Maps in, plain Maps out, no model classes needed.

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 Methods

box(String name, {int version = 1, SmartMigration? onMigrate, Duration writeDelay = const Duration(milliseconds: 300), int isolateThreshold = 500, bool encrypted = false, void onError(Object error, StackTrace stackTrace)?}) → Future<SmartBox>
Opens the box called name (creating it on first use) and caches it, so calling this again with the same name returns the same instance - even if two places ask at the same moment.
closeAll() → Future<void>
Saves and closes every open box (mostly useful in tests).
flushAll() → Future<void>
Saves every open box to disk right now.
lazyBox(String name, {List<String> indexes = const [], bool encrypted = false, int compactMinBytes = 1024 * 1024}) → Future<SmartLazyBox>
Opens a disk-backed box for BIG data (see SmartLazyBox): only ids live in memory, records are read from disk on demand. Reads are async.