removeTask method
Removes a specific task from the queue.
Returns true if the task was found and removed, false otherwise.
Implementation
@pragma('vm:prefer-inline')
bool removeTask(Task<T> task) {
assert(isNotExecuting, 'Cannot modify while tasks are executing.');
if (isNotExecuting) return tasks.remove(task);
return false;
}