updateState method

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

Updates the state using a function.

Implementation

void updateState(T Function(T current) updater) {
  state = updater(state);
}