onDragUpdate method

  1. @override
bool? onDragUpdate(
  1. DragUpdateDetails e
)
override

Implementation

@override
bool? onDragUpdate(DragUpdateDetails e) {
  double maxDy = double.infinity;
  if (ele.linkedList.last.element != null) {
    maxDy = ele.linkedList.last.offset.dy - constraints.maxHeight;
  }

  final newScrollPosition = Offset(
    0,
    max(min(scrollPosition.dy + e.delta.dy, 0), -maxDy),
  );

  if (newScrollPosition != scrollPosition) {
    scrollPosition = newScrollPosition;
    markNeedsLayout();
  }

  return super.onDragUpdate(e);
}