scheduleTask<T> method

  1. @override
Future<T> scheduleTask<T>(
  1. TaskCallback<T> task,
  2. Priority priority, {
  3. String? debugLabel,
  4. Flow? flow,
})
override

Schedules the given task with the given priority.

If task returns a future, the future returned by scheduleTask will complete after the former future has been scheduled to completion. Otherwise, the returned future for scheduleTask will complete with the same value returned by task after it has been scheduled.

The debugLabel and flow are used to report the task to the Timeline, for use when profiling.

Processing model

Tasks will be executed between frames, in priority order, excluding tasks that are skipped by the current schedulingStrategy. Tasks should be short (as in, up to a millisecond), so as to not cause the regular frame callbacks to get delayed.

If an animation is running, including, for instance, a ProgressIndicator indicating that there are pending tasks, then tasks with a priority below Priority.animation won't run (at least, not with the defaultSchedulingStrategy; this can be configured using schedulingStrategy).

Implementation

@override
Future<T> scheduleTask<T>(task, Priority priority,
    {String? debugLabel, Flow? flow}) {
  throw UnimplementedError();
}