onUpdate method

dynamic onUpdate(
  1. void onUpdateCallback(
    1. T value
    )
)

To be notified when Variable.value changes register a callback by calling this method. The callback will replace any previously registered callback.

callback called with the updated variable

Implementation

onUpdate(void Function(T value) onUpdateCallback) {
  callback = onUpdateCallback;
}