Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ extension _WidgetGestureHandlers<T, C> on _NodeFlowEditorState<T, C> {
if (node == null) return;

// Find the port
final port = [
...node.inputPorts,
...node.outputPorts,
].where((p) => p.id == portId).firstOrNull;
// Use node.ports directly to avoid duplicates when port has PortType.both
final port = node.ports.where((p) => p.id == portId).firstOrNull;
if (port == null) return;

widget.controller.events.port?.onContextMenu?.call(
Expand Down
18 changes: 5 additions & 13 deletions packages/vyuh_node_flow/lib/src/nodes/node_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,11 @@ class NodeContainer<T> extends StatelessWidget {
),
),

// Input ports (only when LOD allows and ports exist)
// Use port.isOutput to respect PortType (input, output, both)
// rather than list membership
if (lodVisibility.showPorts && node.inputPorts.isNotEmpty)
...node.inputPorts.map(
(port) => _buildPort(context, port, port.isOutput),
),

// Output ports (only when LOD allows and ports exist)
// Use port.isOutput to respect PortType (input, output, both)
// rather than list membership
if (lodVisibility.showPorts && node.outputPorts.isNotEmpty)
...node.outputPorts.map(
// Ports (only when LOD allows and ports exist)
// Iterate over all ports directly to avoid duplicate rendering
// when a port has PortType.both (would appear in both inputPorts and outputPorts)
if (lodVisibility.showPorts && node.ports.isNotEmpty)
...node.ports.map(
(port) => _buildPort(context, port, port.isOutput),
),

Expand Down