portsFor method

List<PortDefinition> portsFor(
  1. ShapeElement shape
)

Implementation

List<PortDefinition> portsFor(ShapeElement shape) => switch (kind) {
  ShapeConnectionKind.fixedPorts => fixedPorts,
  ShapeConnectionKind.instancePorts =>
    shape.ports.isEmpty
        ? _defaultPorts()
        : [for (final port in shape.ports) PortDefinition.fromInstance(port)],
  ShapeConnectionKind.none || ShapeConnectionKind.outline => const [],
};