isPrevSystemCard method

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

Implementation

bool isPrevSystemCard({required int listIndex, required int itemIndex}) {
  var prov = ref.read(ProviderList.boardProvider);
  var item = prov.board.lists[listIndex].items[itemIndex];
  var isItemHidden = itemIndex - 1 >= 0 &&
      prov.draggedItemState!.itemIndex == itemIndex - 1 &&
      prov.draggedItemState!.listIndex == listIndex;
  if (prov.board.lists[prov.board.dragItemOfListIndex!]
          .items[prov.board.dragItemIndex!].addedBySystem ==
      true) {
    prov.board.lists[prov.board.dragItemOfListIndex!].items.removeAt(0);
    log("ITEM REMOVED");

    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
      prov.board.lists[prov.board.dragItemOfListIndex!].setState!();
      if (isItemHidden) {
        //  print("ITEM HIDDEN");
        prov.move = "DOWN";
      }
      prov.board.dragItemIndex = itemIndex;
      prov.board.dragItemOfListIndex = listIndex;

      //  log("UPDATED | ITEM= ${prov.board.dragItemIndex} | LIST= $listIndex");
      item.setState!();
    });

    return true;
  }
  return false;
}