onPointerMove method

  1. @override
bool? onPointerMove(
  1. PointerMoveEvent e
)
override

指针移动处理

Implementation

@override
bool? onPointerMove(PointerMoveEvent e) {
  super.onPointerMove(e);
  if (isCancel == null) {
    // 如果指针离开元素或者移动偏移大于预定值,则取消触发 onTap 事件
    if (isActiveLongPress == null) {
      if (!size.contains(e.localPosition)) {
        onCancel();
      } else if ((e.position - tapDownPosition!).distance > kTouchSlop) {
        onCancel();
      }
    }
  }

  return true;
}