addPostFrameCallback method
- FrameCallback callback
Schedule a callback for the end of this frame.
The provided callback is run immediately after a frame, just after the persistent frame callbacks (which is when the main rendering pipeline has been flushed).
This method does not request a new frame. If a frame is already in progress and the execution of post-frame callbacks has not yet begun, then the registered callback is executed at the end of the current frame. Otherwise, the registered callback is executed after the next frame (whenever that may be, if ever).
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:
- scheduleFrameCallback, which registers a callback for the start of the next frame.
Implementation
void addPostFrameCallback(FrameCallback callback) {
_postFrameCallbacks.add(callback);
}