scheduleTask<T> function

Future<T> scheduleTask<T>(
  1. FutureOr<T> task()
)

Schedules the given task with the Priority.animation and returns a Future that completes to the task's eventual return value.

Implementation

Future<T> scheduleTask<T>(FutureOr<T> Function() task) async =>
    await SchedulerBinding.instance
        .scheduleTask<FutureOr<T>>(task, Priority.animation);