onPointerMove method
指针移动处理
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;
}