Flutter SchedulerBinding

Created At: 2023-02-20 18:40:28 Updated At: 2023-02-20 19:44:21

SchedulerBinding is scheduler which runs callbacks(functions). When it comes to SchedulerBinding, callback functions are divided in three categories.

Transient callbacks

triggered by the system's dart:ui.PlatformDispatcher.onBeginFrame callback, for synchronizing the application's behavior to the system's display. For example, Tickers and AnimationControllers trigger from these.

Simply speaking, Trasient callbacks dispatch work and manage system's display.

Persistent callbacks

triggered by the system's dart:ui.PlatformDispatcher.onDrawFrame callback, for updating the system's display after transient callbacks have executed. For example, the rendering layer uses this to drive its rendering pipeline.

Here, it updates the system display but in the lower level of the API.

Post-frame callbacks

which are run after persistent callbacks, just before returning from the dart:ui.PlatformDispatcher.onDrawFrame callback.
Non-rendering tasks, to be run between frames. These are given a priority and are executed in priority order according to a schedulingStrategy.

These callbacks are added directly from the app UI. Here in our chat application we used Post-frame callbacks a few times.


Add Reviews