createTask

abstract fun createTask(    text: String,     category: String,     additionalDescription: String? = null,     position: Int? = 0,     listener: RainbowListener<Task, TaskRepository.CreateTaskError>? = null)

Creates a Task associated with a specified category.

This function allows the user to create a new task, which is then associated with the provided category. Once the task is successfully created, it is returned in the listener's onSuccess method. The taskList will also be updated to reflect the addition of the new task.

Additionally, for creating a task from an existing message, refer to the createTaskFromMessage method.

Parameters

text

The content of the task. This parameter is required and must not be null or empty.

category

The category associated with the task. This parameter is required and must not be null or empty.

additionalDescription

An optional additional description for the task, providing further context. Defaults to null if not specified.

position

The position of the task in the list. Defaults to 0 if not specified.

listener

An optional callback of type RainbowListener<Task, TaskRepository.CreateTaskError>, which is invoked upon completion of the operation. If not required, set to null.