endDrag method

void endDrag()

Ends the drag operation

Implementation

void endDrag() {
  if (_isDragging && _startListIndex != null && _startItemIndex != null && _draggedListIndex != null && _draggedItemIndex != null) {
    _callbacks?.onDragEnd?.call(_startListIndex!, _startItemIndex!, _draggedListIndex!, _draggedItemIndex!);

    // Also call more specific callbacks
    if (_startListIndex == _draggedListIndex) {
      _callbacks?.onItemReorder?.call(_startListIndex!, _startItemIndex!, _draggedItemIndex!);
    } else {
      _callbacks?.onItemMove?.call(_startListIndex!, _startItemIndex!, _draggedListIndex!, _draggedItemIndex!);
    }
  }

  _draggedItem = null;
  _draggedListIndex = null;
  _draggedItemIndex = null;
  _startListIndex = null;
  _startItemIndex = null;
  _currentPosition = null;
  _isDragging = false;
  notifyListeners();
}