createRecognizer method

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

@override
@protected
MultiDragGestureRecognizer createRecognizer(GestureMultiDragStartCallback onStart) {
  switch (affinity) {
    case Axis.horizontal:
      return LeftHorizontalMultiDragGestureRecognizer(
        buttonCodes: buttons.map((e) => e.code).toList(),
      )..onStart = onStart;
    case Axis.vertical:
      return LeftVerticalMultiDragGestureRecognizer(
        buttonCodes: buttons.map((e) => e.code).toList(),
      )..onStart = onStart;
    case null:
      return LeftImmediateMultiDragGestureRecognizer(
        buttonCodes: buttons.map((e) => e.code).toList(),
      )..onStart = onStart;
  }
}