onDragMove method

  1. @override
void onDragMove(
  1. Offset delta,
  2. AnnotationDragContext context
)
override

Called during drag with the movement delta.

Override this method to perform actions while the annotation is being dragged. Use the context to move related nodes or perform other operations. The delta is in graph coordinates.

Example

@override
void onDragMove(Offset delta, AnnotationDragContext context) {
  if (_containedNodeIds != null && _containedNodeIds!.isNotEmpty) {
    context.moveNodes(_containedNodeIds!, delta);
  }
}

Implementation

@override
void onDragMove(Offset delta, AnnotationDragContext context) {
  // Move all contained nodes along with this group
  if (_containedNodeIds != null && _containedNodeIds!.isNotEmpty) {
    context.moveNodes(_containedNodeIds!, delta);
  }
}