moveListRight method

void moveListRight()

Implementation

void moveListRight() {
  var prov = ref.read(ProviderList.boardProvider);
  if (prov.draggedItemState!.listIndex == prov.board.lists.length - 1) {
    return;
  }
  if (prov.valueNotifier.value.dx +
          prov.board.lists[prov.draggedItemState!.listIndex!].width! / 2 <
      prov.board.lists[prov.draggedItemState!.listIndex! + 1].x!) {
    return;
  }
  // dev.log("LIST RIGHT");
  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! - 1].setState!();
  prov.board.lists[prov.draggedItemState!.listIndex!].setState!();
}