removeLastTask method

bool removeLastTask()

Removes the last task from the queue.

Returns true if a task was removed, false if the queue was empty.

Implementation

@pragma('vm:prefer-inline')
bool removeLastTask() {
  assert(isNotExecuting, 'Cannot modify while tasks are executing.');
  if (!isNotExecuting || tasks.isEmpty) return false;
  tasks.removeLast();
  return true;
}