computePanSlop function

double computePanSlop(
  1. PointerDeviceKind kind,
  2. DeviceGestureSettings? settings
)

Determine the appropriate pan slop pixels based on the kind of pointer.

Implementation

double computePanSlop(PointerDeviceKind kind, DeviceGestureSettings? settings) {
  switch (kind) {
    case PointerDeviceKind.mouse:
      return kPrecisePointerPanSlop;
    case PointerDeviceKind.stylus:
    case PointerDeviceKind.invertedStylus:
    case PointerDeviceKind.unknown:
    case PointerDeviceKind.touch:
    case PointerDeviceKind.trackpad:
      return settings?.panSlop ?? kPanSlop;
  }
}