scheduleUpdate method

void scheduleUpdate()

Asynchronously schedule an action for later in the VM turn.

Calling multiple times before one completes has no effect.

Implementation

void scheduleUpdate() {
  if (!_isUpdateScheduled) {
    _isUpdateScheduled = true;
    scheduleMicrotask(() {
      _isUpdateScheduled = false;
      if (_updateCallback != null) {
        _updateCallback!();
      }
      if (_onUpdateStreamController != null) {
        _onUpdateStreamController!.add(null);
      }
    });
  }
}