getLinkEndpointAlignment method

  1. @override
Alignment getLinkEndpointAlignment(
  1. ComponentData componentData,
  2. Offset targetPoint
)

Calculates an alignment of link endpoint on a component from ComponentData and targetPoint (nearest link point from this component).

With no implementation the link will attach to center of the component.

Implementation

@override
Alignment getLinkEndpointAlignment(
    ComponentData componentData, Offset targetPoint) {
  if (componentData.data.isInput) {
    return Alignment.centerLeft;
  } else {
    return Alignment.centerRight;
  }
}