task method
- required CAsyncTask task,
- dynamic data,
- int delay = 0,
Will process a one off asynchronous task on the main flutter thread.
Implementation
Future<dynamic> task({
required CAsyncTask task,
dynamic data,
int delay = 0,
}) async {
return (
await Future.delayed(
Duration(milliseconds: delay),
() => task(data),
),
);
}