update method

void update(
  1. T updater(
    1. T current
    )
)

Updates the value using a function and notifies listeners if changed.

Implementation

void update(T Function(T current) updater) {
  value = updater(_value);
}