connectComponents method

dynamic connectComponents(
  1. String? sourceComponentId,
  2. String? targetComponentId,
  3. Color color
)

Implementation

connectComponents(
    String? sourceComponentId, String? targetComponentId, Color color) {
  if (sourceComponentId == null || targetComponentId == null) return false;
  if (!canConnectThesePorts(sourceComponentId, targetComponentId)) {
    return false;
  }

  canvasWriter.model.connectTwoComponents(
    sourceComponentId: sourceComponentId,
    targetComponentId: targetComponentId,
    linkStyle: LinkStyle(
      arrowType: ArrowType.none,
      color: color,
      lineWidth: 4,
    ),
  );
  hideAllHighLights();

  return true;
}