scheduleRender method

void scheduleRender()

Schedules a render to occur at the end of the current microtask turn.

Multiple calls to this method before the microtask executes are coalesced into a single _render call. This avoids redundant renders when several state-changing messages are processed in one _drainMessageQueue loop or when a burst of events (resize, timer, resume) fire on the same event-loop tick.

For startup paths and explicit repaint requests that must render synchronously, call _render or _forceRender directly instead.

Implementation

void scheduleRender() {
  if (_needsRender) return;
  _needsRender = true;
  scheduleMicrotask(_flushRender);
}