dequeue method

void dequeue(
  1. String id
)

De-queue (remove) an UserTask with id from the userTasks.

Implementation

void dequeue(String id) {
  UserTask? userTask = _userTaskMap[id];
  if (userTask == null) {
    warning(
        "$runtimeType - Could not dequeue AppTask - id is not valid: '$id'");
  } else {
    userTask.state = UserTaskState.dequeued;
    _userTaskMap.remove(id);
    _controller.sink.add(userTask);
    info('$runtimeType - Dequeued $userTask');

    if (notificationsEnabled) {
      SmartPhoneClientManager()
          .notificationController
          ?.cancelTaskNotification(userTask);
    }
  }
}