mutate method

void mutate(
  1. void mutater(
    1. T value
    )
)

Updates the value by calling the mutating function and then saving the value.

Implementation

void mutate(void Function(T value) mutater) {
  final mutableValue = value;
  mutater(mutableValue);
  value = mutableValue;
}