onDone method

  1. @mustCallSuper
void onDone({
  1. bool dequeue = false,
  2. Data? result,
})

Called by the app when the user has finished this task.

Sets result, doneTime and state, and marks the task as done in the AppTaskController. If dequeue is true the task is also removed from the queue.

Implementation

@mustCallSuper
void onDone({bool dequeue = false, Data? result}) {
  this.result = result;
  doneTime = DateTime.now();
  state = UserTaskState.done;
  AppTaskController().done(id, result);
  if (dequeue) AppTaskController().dequeue(id);
}