portIdAt method

String portIdAt(
  1. int portIndex
)

Return the ID of the port at portIndex in elkPorts.

Falls back to a synthesized string only when portIndex is out of range (defensive — should not happen with well-formed data).

Implementation

String portIdAt(int portIndex) =>
    portIndex >= 0 && portIndex < elkPorts.length
        ? elkPorts[portIndex].id
        : '$id:$portIndex';