cancelDrag static method

void cancelDrag()

Cancels the current drag session.

Implementation

static void cancelDrag() {
  final target = _lastHoveredTarget;
  if (target != null) {
    if (target.mounted) {
      target.handleDragLeave(_activeSession);
    }
    _lastHoveredTarget = null;
  }
  _activeSession = null;
  onDragSessionChanged?.call(null);
}