getMultitouchDragStrategy method

MultitouchDragStrategy getMultitouchDragStrategy(
  1. BuildContext context
)

Configure the multi-finger drag strategy on multi-touch devices.

If set to MultitouchDragStrategy.latestPointer, the drag gesture recognizer will only track the latest active (accepted by this recognizer) pointer, which appears to be only one finger dragging.

If set to MultitouchDragStrategy.averageBoundaryPointers, all active pointers will be tracked, and the result is computed from the boundary pointers.

If set to MultitouchDragStrategy.sumAllPointers, all active pointers will be tracked together and the scrolling offset is the sum of the offsets of all active pointers

By default, MultitouchDragStrategy.latestPointer is configured to create drag gestures for non-Apple platforms, and MultitouchDragStrategy.averageBoundaryPointers for Apple platforms.

Implementation

MultitouchDragStrategy getMultitouchDragStrategy(BuildContext context) {
  switch (getPlatform(context)) {
    case TargetPlatform.macOS:
    case TargetPlatform.iOS:
      return MultitouchDragStrategy.averageBoundaryPointers;
    case TargetPlatform.linux:
    case TargetPlatform.windows:
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
      return MultitouchDragStrategy.latestPointer;
  }
}