getGesturesHorizontal method

  1. @override
Map<Type, GestureRecognizerFactory<GestureRecognizer>> getGesturesHorizontal(
  1. BuildContext context
)
override

Implementation

@override
Map<Type, GestureRecognizerFactory> getGesturesHorizontal(
    BuildContext context) {
  final Map<Type, GestureRecognizerFactory> gestures =
      <Type, GestureRecognizerFactory>{};
  if (!enableGestures) {
    return gestures;
  }

  gestures[_ThumbPressGestureRecognizer] =
      GestureRecognizerFactoryWithHandlers<_ThumbPressGestureRecognizer>(
    () => _ThumbPressGestureRecognizer(
      debugOwner: this,
      context: context,
      scrollbarPainter: horizontalScrollbar,
      duration: pressDuration,
    ),
    (_ThumbPressGestureRecognizer instance) {
      instance.onLongPress = handleThumbPressHorizontal;
      instance.onLongPressStart = (LongPressStartDetails details) =>
          handleThumbPressStartHorizontal(details.globalPosition);
      instance.onLongPressMoveUpdate = (LongPressMoveUpdateDetails details) =>
          handleThumbPressUpdateHorizontal(details.globalPosition);
      instance.onLongPressEnd = (LongPressEndDetails details) =>
          handleThumbPressEndHorizontal(
              details.globalPosition, details.velocity);
    },
  );

  gestures[_TrackTapGestureRecognizer] =
      GestureRecognizerFactoryWithHandlers<_TrackTapGestureRecognizer>(
    () => _TrackTapGestureRecognizer(
      debugOwner: this,
      context: context,
      scrollbarPainter: horizontalScrollbar,
    ),
    (_TrackTapGestureRecognizer instance) {
      instance.onTapDown = handleTrackTapDownHorizontal;
    },
  );

  return gestures;
}