updateDrag method

void updateDrag(
  1. double delta,
  2. double availableHeight
)

Update drag by delta pixels (negative = up/expand, positive = down/collapse).

availableHeight is the screen height used to normalise pixel delta.

Implementation

void updateDrag(double delta, double availableHeight) {
  if (!_state.isDragging) return;
  if (availableHeight <= 0) return;

  final newProgress = (_animationController.value - delta / availableHeight)
      .clamp(0.0, 1.0);
  _animationController.value = newProgress;
  _setState(_state.copyWith(progress: newProgress));
}