PersistentValue<T> class

This class extends the StreamedValue class of the frideos package in order to take advantages of the stream, so that, every time a new value is set, this is both stored in the database (if the flag continuousSave is set to true ) and sent to the stream to drive a StreamBuilder or a ValueBuilder to update the UI.

Inheritance
Implementers

Constructors

PersistentValue({@required String persistentKey, String table: 'kvp', T initialData, bool continuousSave: true})

Properties

continuousSave → bool
This flag indicates if the new value needs to be saved on every update. If set to false, it is necessary to call the save method to store the value to the database. By default is true.
final
persistentKey → String
final
table → String
final
value ↔ T
Getter for the last value emitted by the stream
read / write, inherited-getter, override-setter
hashCode → int
The hash code for this object.
read-only, inherited
initialData ↔ T
The initial event of the stream
read / write, inherited
inStream → Function
Sink for the stream
read-only, inherited
onError → Function
Callback to handle the errors
final, inherited
outStream → Stream<T>
Stream getter
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
stream BehaviorSubject<T>
Stream of type BehaviorSubject in order to emit the last event to every new listener.
read / write, inherited
timesUpdated ↔ int
timesUpdate shows how many times the stream got updated
read / write, inherited

Methods

init({DbProvider dbProvider}) → Future<void>
This method takes as a parameter an initialiazed instance of a DbProvider, initialize the KeyValueProvider that creates the table in which they key/value pairs are stored. [...]
save() → Future<void>
This method needs to be used whern continuousSave is set to false, to store update the value in the database.
debugMode() → void
To enable the debug mode
inherited
dispose() → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
onChange(dynamic onDataChanged(T data)) → void
To set a function that will be called every time the stream updates.
inherited
refresh() → void
Method to refresh the stream (e.g to use when the type it is not a basic type, and a property of an object has changed).
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

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