finishDrag method
void
finishDrag(
- _DragEndKind endKind, [
- 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);
}