updateInputPort method

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

Updates an existing input 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 updateInputPort(String portId, Port updatedPort) {
  return runInAction(() {
    final index = inputPorts.indexWhere((port) => port.id == portId);
    if (index >= 0) {
      inputPorts[index] = updatedPort;
      return true;
    }
    return false;
  });
}