addPostFrameCallback method Null safety

void addPostFrameCallback(
  1. FrameCallback callback
)

Schedule a callback for the end of this frame.

Does not request a new frame.

This callback is run during a frame, just after the persistent frame callbacks (which is when the main rendering pipeline has been flushed). If a frame is in progress and post-frame callbacks haven't been executed yet, then the registered callback is still executed during the frame. Otherwise, the registered callback is executed during the next frame.

The callbacks are executed in the order in which they have been added.

Post-frame callbacks cannot be unregistered. They are called exactly once.

See also:

Implementation

void addPostFrameCallback(FrameCallback callback) {
  _postFrameCallbacks.add(callback);
}