value property

T value

The getter to get the value of the variable

Implementation

T get value {
  return _value;
}
void value=(T setValue)

The setter to set the value of the variable

Implementation

set value(T setValue) {
  /// Checks if [beforeChange] is null and calls with the current value
  if (this.beforeChange != null) {
    this.beforeChange!(this.value);
  }

  /// Sets the value of the variable
  this._value = setValue;

  /// Checks if [afterChange] is null and calls with the new value
  if (this.afterChange != null) {
    this.afterChange!(setValue);
  }

  this._callbacks.forEach((callback) {
    callback();
  });
}