Tx<T> class
Tx<T>
is a Trackable variable that can used to set callbacks which can be called before and after changes are made to the variable.
T value
Is the actual value of the variable. It is split into a Getter and a Setter.
void Function(T)? beforeChange
Is called just before a change of value happens to the variable. This can be null, in which case, there will be no callback before change in value.
void Function(T)? afterChange
Is called immediately after a change of value of the variable happens. This can be null, in which case, there will be no callback after change in value.
- Available Extensions
Constructors
- Tx(T value, {void beforeChange(T)?, void afterChange(T)?})
-
The
Tx<T>
constructor.Tx<T>
is a Trackable variable that can used to set callbacks which can be called before and after changes are made to the variable. The variable is of generic typeT
which means it can hold any type of value.
Properties
- afterChange ↔ (void Function(T)?)
-
This function will be called after the value of the variable has been changed.
getter/setter pair
- beforeChange ↔ (void Function(T)?)
-
This function will be called before the value of the variable has been changed.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ T
-
The getter to get the value of the variable
getter/setter pair
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