findDropTargetItem method
_Item?
findDropTargetItem()
Implementation
_Item? findDropTargetItem() {
_Item? target = dragItem;
// Boxes are in the order in which they are build, not
// necessarily index based.
final boxes = _itemBoxes.values.toList()
..sort((a, b) => a.index!.compareTo(b.index!));
for (final box in boxes) {
// Dont apply any translation to the currently dragged
// item (#56)
final t = box == dragItem ? 0.0 : getTranslation(box.key);
if (_up) {
if (_dragStart <= (box.start + t)) {
return box;
}
} else {
if (_dragEnd >= (box.end + t)) {
target = box;
}
}
}
return target;
}