scheduleWarmUpFrame method

  1. @override
void scheduleWarmUpFrame ()
override

Schedule a frame to run as soon as possible, rather than waiting for the engine to request a frame in response to a system "Vsync" signal.

This is used during application startup so that the first frame (which is likely to be quite expensive) gets a few extra milliseconds to run.

Locks events dispatching until the scheduled frame has completed.

If a frame has already been scheduled with scheduleFrame or scheduleForcedFrame, this call may delay that frame.

If any scheduled frame has already begun or if another scheduleWarmUpFrame was already called, this call will be ignored.

Prefer scheduleFrame to update the display in normal operation.

Implementation

@override
void scheduleWarmUpFrame() {
  // We override the default version of this so that the application-startup warm-up frame
  // does not schedule timers which we might never get around to running.
  handleBeginFrame(null);
  _currentFakeAsync.flushMicrotasks();
  handleDrawFrame();
  _currentFakeAsync.flushMicrotasks();
}