moveListLeft method

void moveListLeft()

Implementation

void moveListLeft() {
  var prov = ref.read(ProviderList.boardProvider);
  if (prov.draggedItemState!.listIndex == 0) {
    return;
  }
  if (prov.valueNotifier.value.dx >
      prov.board.lists[prov.draggedItemState!.listIndex! - 1].x! +
          (prov.board.lists[prov.draggedItemState!.listIndex! - 1].width! /
              2)) {
    // dev.log(
    // "RETURN LEFT LIST ${prov.valueNotifier.value.dx} ${prov.board.lists[prov.draggedItemState!.listIndex! - 1].x! + (prov.board.lists[prov.draggedItemState!.listIndex! - 1].width! / 2)} ");
    return;
  }
  // dev.log("LIST LEFT ${prov.valueNotifier.value.dx} ${prov.board.lists[prov.draggedItemState!.listIndex! - 1].x! + (prov.board.lists[prov.draggedItemState!.listIndex! - 1].width! / 2)} ");
  prov.board.lists.insert(prov.draggedItemState!.listIndex! - 1,
      prov.board.lists.removeAt(prov.draggedItemState!.listIndex!));
  prov.draggedItemState!.listIndex = prov.draggedItemState!.listIndex! - 1;
  prov.board.dragItemOfListIndex = null;
  prov.board.dragItemIndex = null;
  prov.draggedItemState!.itemIndex = null;
  prov.board.lists[prov.draggedItemState!.listIndex!].setState!();
  prov.board.lists[prov.draggedItemState!.listIndex! + 1].setState!();
}