Map<Type, GestureRecognizerFactory> buildGestureDetectors()

Return the gesture detectors, in the form expected by RawGestureDetector.gestures and RawGestureDetectorState.replaceGestureRecognizers, that are applicable to this Scrollable in its current state.

This is called by build and updateGestureDetector.

Source

Map<Type, GestureRecognizerFactory> buildGestureDetectors() {
  if (scrollBehavior.isScrollable) {
    switch (config.scrollDirection) {
      case Axis.vertical:
        return <Type, GestureRecognizerFactory>{
          VerticalDragGestureRecognizer: (VerticalDragGestureRecognizer recognizer) {  // ignore: map_value_type_not_assignable, https://github.com/flutter/flutter/issues/5771
            return (recognizer ??= new VerticalDragGestureRecognizer())
              ..onDown = _handleDragDown
              ..onStart = _handleDragStart
              ..onUpdate = _handleDragUpdate
              ..onEnd = _handleDragEnd;
          }
        };
      case Axis.horizontal:
        return <Type, GestureRecognizerFactory>{
          HorizontalDragGestureRecognizer: (HorizontalDragGestureRecognizer recognizer) {  // ignore: map_value_type_not_assignable, https://github.com/flutter/flutter/issues/5771
            return (recognizer ??= new HorizontalDragGestureRecognizer())
              ..onDown = _handleDragDown
              ..onStart = _handleDragStart
              ..onUpdate = _handleDragUpdate
              ..onEnd = _handleDragEnd;
          }
        };
    }
  }
  return const <Type, GestureRecognizerFactory>{};
}