onExpired method

  1. @mustCallSuper
void onExpired({
  1. bool dequeue = true,
})

Called by the app when this task expires.

If dequeue is true (the default) the task is removed from the queue, which also deletes it from persistent storage. Pass false to keep it on the queue with state UserTaskState.expired, so it still counts in AppTaskController.taskExpired.

Implementation

@mustCallSuper
void onExpired({bool dequeue = true}) {
  AppTaskController().expire(id);
  if (dequeue) AppTaskController().dequeue(id);
}