handleTrackTapDownHorizontal method

void handleTrackTapDownHorizontal(
  1. TapDownDetails details
)

Implementation

void handleTrackTapDownHorizontal(TapDownDetails details) {
  // The Scrollbar should page towards the position of the tap on the track.

  Matrix4 transform = controlInterface.getTransform();
  final ScrollMetrics metrics = getScrollMetricsH(transform,
      controlInterface.getViewport(), controlInterface.getContent());
  if (!physics.shouldAcceptUserOffset(metrics)) {
    return;
  }
  late final double delta;
  if (details.localPosition.dx < horizontalScrollbar.thumbOffset) {
    delta = -metrics.viewportDimension * 0.8;
  } else {
    delta = metrics.viewportDimension * 0.8;
  }
  controlInterface.animateHorizontal(
    delta,
    const Duration(milliseconds: 100),
    Curves.easeInOut,
  );
}