handleThumbPressUpdate method Null safety

  1. @protected
  2. @mustCallSuper
void handleThumbPressUpdate (
  1. Offset localPosition
)

Handler called when a currently active long press gesture moves.

Updates the position of the child scrollable.

Implementation

@protected
@mustCallSuper
void handleThumbPressUpdate(Offset localPosition) {
  final Axis? direction = getScrollbarDirection();
  if (direction == null) {
    return;
  }
  switch(direction) {
    case Axis.vertical:
      _updateScrollPosition(localPosition.dy - _dragScrollbarAxisPosition!);
      _dragScrollbarAxisPosition = localPosition.dy;
      break;
    case Axis.horizontal:
      _updateScrollPosition(localPosition.dx - _dragScrollbarAxisPosition!);
      _dragScrollbarAxisPosition = localPosition.dx;
      break;
  }
}