getXAxisCondition method

bool getXAxisCondition({
  1. required int listIndex,
  2. required int itemIndex,
})

Implementation

bool getXAxisCondition({required int listIndex, required int itemIndex}) {
  var prov = ref.read(ProviderList.boardProvider);

  var right = ((prov.draggedItemState!.width * 0.6) +
              prov.valueNotifier.value.dx >
          prov.board.lists[listIndex].x!) &&
      ((prov.board.lists[listIndex].x! + prov.board.lists[listIndex].width! >
          prov.draggedItemState!.width + prov.valueNotifier.value.dx)) &&
      (prov.board.dragItemOfListIndex != listIndex);
  var left = (((prov.draggedItemState!.width) + prov.valueNotifier.value.dx >
          prov.board.lists[listIndex].x! +
              prov.board.lists[listIndex].width!) &&
      ((prov.draggedItemState!.width * 0.6) + prov.valueNotifier.value.dx <
          prov.board.lists[listIndex].x! +
              prov.board.lists[listIndex].width!) &&
      (prov.board.dragItemOfListIndex != listIndex));

  return (left || right);
}