execute method

void execute(
  1. KanbanColumn column,
  2. int oldIndex,
  3. int newIndex
)

Reorders a task within the same column.

Notifies listeners with a TaskReorderedEvent when successful.

Parameters:

  • column: The column containing the task
  • oldIndex: The current index of the task
  • newIndex: The desired index for the task

Implementation

void execute(KanbanColumn column, int oldIndex, int newIndex) {
  Task task = column.tasks[oldIndex];
  column.reorderTask(oldIndex, newIndex);
  EventNotifier()
      .notify(TaskReorderedEvent(column, task, oldIndex, newIndex));
}