updateFlow<T> method

void updateFlow<T>(
  1. AirStateKey<T> key,
  2. T updater(
    1. T current
    )
)

Helper to update typed state with a function

Implementation

void updateFlow<T>(AirStateKey<T> key, T Function(T current) updater) {
  final current = getFlow(key);
  setFlow(key, updater(current));
}