findPort method

Port? findPort(
  1. String portId
)

Finds a port by ID in either input or output ports.

Parameters:

  • portId - The unique identifier of the port to find

Returns the Port if found, null otherwise.

Implementation

Port? findPort(String portId) {
  try {
    return inputPorts.firstWhere((port) => port.id == portId);
  } catch (_) {
    try {
      return outputPorts.firstWhere((port) => port.id == portId);
    } catch (_) {
      return null;
    }
  }
}