SimpleJsonPersistenceWithDefault<T extends HasToJson> class
- Inheritance
-
- Object
- SimpleJsonPersistence<
T> - SimpleJsonPersistenceWithDefault
Properties
- cachedValue → T?
-
Useful for using as
initialValue
inStreamBuilder
.no setterinherited - defaultCreator → (T Function()?)
-
finalinherited
-
fromJson
↔ FromJson<
T> -
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Name of the store (used as file name for the .json file)
finalinherited
-
onValueChanged
→ Stream<
T> -
Stream which will receive a new notification on every save call.
no setteroverride
-
onValueChangedAndLoad
→ Stream<
T> -
Stream with the current value as first event,
concatenated with onValueChanged.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storeBackend → StoreBackend
-
finalinherited
Methods
-
delete(
) → Future< void> -
inherited
-
dispose(
) → Future< void> -
Removes this store from memory. Probably not really useful in a
real world app and should not be used outside of testing.
inherited
-
load(
) → Future< T> -
Loads and deserializes data from storage. It is safe to be called
multiple times.
Subsequent calls will return the same future. If loaded, the cached
value will be returned. (cachedValue).
If file does not exist the default value (defaultCreator) will be
returned.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onValueChangedOrDefault(
Future< T> defaultValue) → Stream<T?> -
inherited
-
save(
T value) → Future< void> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
T updater(T data)) → Future< T> -
Convenience method which allows simple updating of data.
The
updater
gets the current value as parameter and is expected to return a copy with the new values which will be persisted afterwards.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited