WrenchStore class

WrenchStore provides utility methods to save/lookup instances of any type.

Only 1 instance of a type exists at any point of time.

Annotations

Constructors

WrenchStore()

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

hiveBox String?
getter/setter pair
persistent bool
getter/setter pair

Static Methods

config({bool isPersistent = false, String? storeName}) → void
delete<T>() → void
Removes instance of type T, if exists
deletePersistedState(List<String> deleteModels) Future<void>
get<T>() → T?
Looks up instance of type T, if exists. Returns null if instance of type T is not found.
initPersistence(String? storeLocation) Future<void>
Creates directory boxDir in the file system to save serialized objects storeLocation is optional for Web
nuke() → void
Delete all objects from the store
persistObject(String key, String value) Future<void>
Writes serialized object to a file
restoreState(void callback(void update<T>(T t), String modelName, String jsonStr), List<String> serializerNames) Future<void>
Deserializes the previously serialized string into an object and makes it available in the WrenchStore
update<T>(T t) → void
Saves instance t after removing, if exists, an instance of T
update2<T, S>(T t, S s) → void
Saves instances t and s after removing, if exists, an instance of type T and an instance of type S.
update3<T, S, U>(T t, S s, U u) → void
Saves instances t, s, u after removing, if exists, an instance of type T, instance of type S and instance of type U
update4<T, S, U, V>(T t, S s, U u, V v) → void
Saves instances t, s, u, v after removing, if exists, an instance of type T, instance of type S, instance of type U and instance of type V