update method

T update(
  1. T fn(
    1. T
    )
)

Updates the contained value using fn and returns the new value

Implementation

@pragma("vm:prefer-inline")
T update(T Function(T) fn) {
  _val = fn(_val);
  return _val;
}