DragDropHandler class

Service for handling drag and drop logic with alignment snapping

Constructors

DragDropHandler({double snapThreshold = 10.0})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapThreshold double
final

Methods

calculateSnap({required Offset dragPosition, required Map<String, Offset> existingPositions, required String? draggingNodeId}) SnapResult
Calculate snapped position based on existing node positions Returns snapped offset and lists of guide lines to display
findNearestDropZone({required Offset position, required List<Offset> validZones, double maxDistance = 100.0}) Offset?
Calculate optimal drop zone based on proximity to existing nodes
isValidDropPosition({required Offset position, required Map<String, Offset> existingPositions, required Size nodeSize, String? excludeNodeId}) bool
Check if a position is valid for dropping (e.g., not overlapping)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited