handleFrame method

void handleFrame(
  1. Duration timeStamp
)

Ticks an active snapshot and requests another frame while work remains.

Callback failures are reported with their original stack traces to the zone in which this frame dispatch began. One ticker cannot starve a sibling or suppress the next frame while active work remains.

Implementation

void handleFrame(Duration timeStamp) {
  if (_activeTickers.isEmpty) {
    return;
  }

  _isHandlingFrame = true;
  try {
    final reportingZone = Zone.current;
    final tickers = List<Ticker>.from(_activeTickers);
    for (final ticker in tickers) {
      try {
        ticker._tick(timeStamp);
      } on Object catch (error, stackTrace) {
        reportingZone.handleUncaughtError(error, stackTrace);
      }
    }
  } finally {
    _isHandlingFrame = false;
  }

  if (_activeTickers.isNotEmpty) {
    _requestFrame();
  }
}