update method

T update(
  1. T update(
    1. T value
    )
)

Implementation

T update(T Function(T value) update) {
  final newValue = update(value);
  value = newValue;
  return newValue;
}