Node<T> constructor
Node<T> ({})
Creates a new node with the specified properties.
Parameters:
id- Unique identifier for this nodetype- Type classification for the node (e.g., 'input', 'processor', 'output')position- Initial position in the graph coordinate spacedata- Custom data associated with this nodesize- Optional size, defaults to 150x100 if not specifiedinputPorts- List of input ports for incoming connectionsoutputPorts- List of output ports for outgoing connectionsinitialZIndex- Initial stacking order, higher values appear on top
Implementation
Node({
required this.id,
required this.type,
required Offset position,
required this.data,
Size? size,
List<Port> inputPorts = const [],
List<Port> outputPorts = const [],
int initialZIndex = 0,
}) : size = Observable(size ?? const Size(150, 100)),
position = Observable(position),
visualPosition = Observable(position),
// Initialize with same position
zIndex = Observable(initialZIndex),
selected = Observable(false),
dragging = Observable(false),
inputPorts = ObservableList.of(inputPorts),
outputPorts = ObservableList.of(outputPorts);