connectComponents method
dynamic
connectComponents(
- String? sourceComponentId,
- String? targetComponentId,
- 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;
}