withTask<T> method
Executes the given cb
and returns it's value if there is a running task.
If no task is running, returns null.
Implementation
T? withTask<T>(T Function(FutureTask task) cb) {
final task = _futureTaskManager.task;
if (task != null) {
return cb(task);
}
return null;
}