updateOutputPort method

bool updateOutputPort(
  1. String portId,
  2. Port updatedPort
)

Updates an existing output port by ID.

Parameters:

  • portId - The unique identifier of the port to update
  • updatedPort - The new port object to replace the existing one

Returns true if the port was found and updated, false otherwise.

Implementation

bool updateOutputPort(String portId, Port updatedPort) {
  return runInAction(() {
    final index = outputPorts.indexWhere((port) => port.id == portId);
    if (index >= 0) {
      outputPorts[index] = updatedPort;
      return true;
    }
    return false;
  });
}