GgValue<T> constructor
GgValue<T> ({})
seed
The initial seed of the value.- If spam is true, each change of the value will be added to the stream.
- If spam is false, updates of the value are scheduled as micro tasks. New updates are not added until the last update has been delivered. Only the last set value will be delivered.
- transform allows you to keep value in a given range or transform it.
parse
is needed whenT
is not String, int, double or bool. It converts a string intoT
.stringify
is needed whenT
is not String, int, double or bool. It converts the value into a String.- name is an optional identifier for the value.
Implementation
GgValue({
required T seed,
this.spam = false,
this.compare,
this.transform,
this.isOk,
T Function(String)? parse,
String Function(T)? stringify,
this.name,
}) : _value = seed,
_seed = seed,
_parse = parse,
_stringify = stringify {
_initController();
_initSync();
}