onDragUpdated method

void onDragUpdated(
  1. double delta
)

Implementation

void onDragUpdated(double delta) {
  if (dragKey == null || dragItem == null) return;

  // Allow the dragged item to be overscrolled to allow for
  // continous scrolling while in drag.
  final overscrollBound =
      _canScroll && !(hasHeader || hasFooter) ? _dragSize : 0;
  // Constrain the dragged item to the bounds of the list.
  const epsilon = 2.0;
  final minDelta = (_headerHeight - (dragItem!.start + overscrollBound)) -
      _scrollDelta -
      epsilon;
  final maxDelta = ((_maxScrollOffset + _listSize + overscrollBound) -
          (dragItem!.bottom + _footerHeight)) -
      _scrollDelta +
      epsilon;

  _pointerDelta = delta.clamp(minDelta, maxDelta);
  _dragDelta = _pointerDelta + _scrollDelta;

  _adjustItemTranslations();
}