up method
Implementation
void up(PointerEvent e) {
_longPress?.cancel();
final downAt = _downAt.remove(e.pointer);
final start = _fingersAtStart[e.pointer];
final most = _most;
final gesture = _gesture;
final focal = gesture == _Gesture.quickZoom ? _quickAnchor : _lastFocal;
final end = e.timeStamp;
final short =
e is PointerUpEvent &&
downAt != null &&
end - downAt < _tapTime &&
start != null &&
(e.localPosition - start).distance < _tapSlop &&
!_moved;
if (_fingers.remove(e.pointer) == null) return;
if (_fingers.isNotEmpty) {
_restart(end);
return;
}
_most = 0;
cursor.value = SystemMouseCursors.grab;
_releaseContextMenu();
final drawn = box.value;
box.value = null;
final release = _released(gesture, most, short, drawn);
_gesture = _Gesture.undecided;
_tapUpAt = null;
_markerTouch = false;
switch (release) {
case _Release.box:
_zoomToBox(drawn!);
case _Release.held:
onSettle?.call();
case _Release.twoFingerTap:
_zoomBy(-1, focal);
case _Release.doubleTap:
_zoomBy(_zoomOutTap ? -1 : 1, e.localPosition);
case _Release.quickZoomDrag:
_coast(focal, end);
case _Release.markerTap:
break;
case _Release.tap:
_tapUpAt = end;
_tapUpPosition = e.localPosition;
onTap?.call(e.localPosition);
onSettle?.call();
case _Release.fling:
_coast(focal, end);
onSettle?.call();
}
}