defaultSchedulingStrategy function

bool defaultSchedulingStrategy({
  1. required int priority,
  2. required SchedulerBinding scheduler,
})

The default SchedulingStrategy for SchedulerBinding.schedulingStrategy.

If there are any frame callbacks registered, only runs tasks with a Priority of Priority.animation or higher. Otherwise, runs all tasks.

Implementation

bool defaultSchedulingStrategy({ required int priority, required SchedulerBinding scheduler }) {
  if (scheduler.transientCallbackCount > 0) {
    return priority >= Priority.animation.value;
  }
  return true;
}