beforeUpdate method

  1. @override
void beforeUpdate(
  1. T oldValue,
  2. T newValue
)
override

Called immediately before a value is updated.

This method can be used to perform actions or validations before a state change occurs. It is called after the decision to update the value has been made but before the internal state is actually modified.

Parameters:

  • oldValue: The current value before the update
  • newValue: The proposed new value for the update

Implementation

@override
void beforeUpdate(T oldValue, T newValue) {
  print("Before update: $oldValue -> $newValue");
}