expire method

void expire(
  1. String id
)

Expire an UserTask. Note that an expired task remains on the queue. If you want to remove a task from the queue, use the dequeue method.

Implementation

void expire(String id) {
  UserTask? userTask = _userTaskMap[id];
  if (userTask == null) {
    warning("Could not expire AppTask - id is not valid: '$id'");
  } else {
    // only expire tasks which are not already done or expired
    if (userTask.state != UserTaskState.done) {
      userTask.state = UserTaskState.expired;
      _controller.add(userTask);
      info('Expired $userTask');
    }
    SmartPhoneClientManager()
        .notificationController
        ?.cancelNotification(userTask);
  }
}