finishDrag method

void finishDrag(
  1. _DragEndKind endKind, [
  2. Velocity? velocity
])

Implementation

void finishDrag(_DragEndKind endKind, [Velocity? velocity]) {
  bool wasAccepted = false;
  if (endKind == _DragEndKind.dropped && _activeTarget != null) {
    _activeTarget?.didDrop(this);
    wasAccepted = true;
    _enteredTargets.remove(_activeTarget);
  }
  _leaveAllEntered();
  _activeTarget = null;
  _entry?.remove();
  _entry = null;
  // TODO(ianh): consider passing _entry as well so the client can perform an animation.
  if (onDragEnd != null)
    onDragEnd!(velocity ?? Velocity.zero, _lastOffset, wasAccepted);
}