queueStateUpdate method

void queueStateUpdate (
  1. StateSetter<P, S> stateSetter
)

queueStateUpdate queues a state change, but does not trigger an update

Implementation

void queueStateUpdate(StateSetter<P, S> stateSetter) {
  // if there is already a _pendingStateSetter combine it with stateSetter
  if (_pendingStateSetter != null) {
    final prevStateSetter = _pendingStateSetter;
    _pendingStateSetter = (dynamic p, dynamic s) =>
        stateSetter(p as P, prevStateSetter(p, s) as S);
  } else {
    _pendingStateSetter =
        (dynamic p, dynamic s) => stateSetter(p as P, s as S);
  }
}