Future<void> withAtomicUpdate(FutureOr<void> Function() bloc) async { final state = _currentState; if (state != null) { state._startAtomicUpdate(); await bloc(); state._endAtomicUpdate(); } }