frameDidDraw method

  1. @override
  2. @mustCallSuper
void frameDidDraw()
override

Called immediately after calling SchedulerBinding.handleDrawFrame.

Implementation

@override
@mustCallSuper
void frameDidDraw() {
  // Only record frames that show the widget.
  if (showWidget) {
    endMeasureFrame();
    profile.addDataPoint('drawFrameDuration', _drawFrameStopwatch.elapsed,
        reported: true);
  }

  if (shouldContinue()) {
    showWidget = !showWidget;
    _hostState._setStateTrampoline();
  } else {
    for (final VoidCallback fn in _didStopCallbacks) {
      fn();
    }
    _runCompleter!.complete();
  }
}