onPointerUp method
指针抬起处理
Implementation
@override
bool? onPointerUp(PointerUpEvent e) {
if (isActiveDrag == true) {
ElPointerManager.isOpen = true;
final VelocityEstimate? estimate = velocityTracker!.getVelocityEstimate();
Velocity velocity = Velocity.zero;
if (estimate != null) {
if (_isFlingGesture(estimate, e.kind)) {
velocity = calcVelocity(estimate) ?? Velocity.zero;
}
}
onDragEnd(
DragEndDetails(
velocity: velocity,
primaryVelocity: calcPrimaryVelocity(velocity.pixelsPerSecond),
globalPosition: e.position,
localPosition: e.localPosition,
),
);
isActiveDrag = null;
velocityTracker = null;
}
return null;
}