createRecognizer method Null safety

  1. @protected
MultiDragGestureRecognizer createRecognizer(
  1. GestureMultiDragStartCallback onStart
)
protected">@protected

Creates a gesture recognizer that recognizes the start of the drag.

Subclasses can override this function to customize when they start recognizing a drag.

Implementation

@protected
MultiDragGestureRecognizer createRecognizer(GestureMultiDragStartCallback onStart) {
  switch (affinity) {
    case Axis.horizontal:
      return HorizontalMultiDragGestureRecognizer()..onStart = onStart;
    case Axis.vertical:
      return VerticalMultiDragGestureRecognizer()..onStart = onStart;
    case null:
      return ImmediateMultiDragGestureRecognizer()..onStart = onStart;
  }
}