Gets the horizontal or vertical component based on the scroll view's scroll axis.
double getComponent(Offset offset) => _scrollPosition?.axis == Axis.horizontal ? offset.dx : offset.dy;