onCancel method

  1. @mustCallSuper
void onCancel(
  1. BuildContext context, {
  2. bool dequeue = false,
})
inherited

Callback from the app if this task is canceled.

If dequeue is true the task is removed from the queue. Otherwise, it it kept on the queue for later.

Implementation

@mustCallSuper
void onCancel(BuildContext context, {bool dequeue = false}) {
  state = UserTaskState.canceled;
  (dequeue)
      ? AppTaskController().dequeue(id)
      : state = UserTaskState.enqueued;
}