NodeWidget<T> constructor
const
NodeWidget<T> ({
- Key? key,
- required Node<
T> node, - Widget? child,
- NodeShape? shape,
- List<
Connection> connections = const [], - void onPortTap()?,
- void onPortHover()?,
- void onNodeTap(
- String nodeId
- void onNodeDoubleTap(
- String nodeId
- ({bool isOutput, String nodeId, String portId})? hoveredPortInfo,
- Color? backgroundColor,
- Color? selectedBackgroundColor,
- Color? borderColor,
- Color? selectedBorderColor,
- double? borderWidth,
- double? selectedBorderWidth,
- BorderRadius? borderRadius,
- EdgeInsets? padding,
Creates a node widget with optional custom content.
Parameters:
node- The node data model to renderchild- Optional custom widget to display as node contentshape- Optional shape for the node (renders shaped node instead of rectangle)connections- List of connections for determining port connection stateonPortTap- Callback when a port is tappedonPortHover- Callback when a port is hoveredonNodeTap- Callback when the node is tappedonNodeDoubleTap- Callback when the node is double-tappedhoveredPortInfo- Information about the currently hovered portbackgroundColor- Custom background color (overrides theme)selectedBackgroundColor- Custom selected background color (overrides theme)borderColor- Custom border color (overrides theme)selectedBorderColor- Custom selected border color (overrides theme)borderWidth- Custom border width (overrides theme)selectedBorderWidth- Custom selected border width (overrides theme)borderRadius- Custom border radius (overrides theme)padding- Custom padding (overrides theme)
Implementation
const NodeWidget({
super.key,
required this.node,
this.child,
this.shape,
this.connections = const [],
this.onPortTap,
this.onPortHover,
this.onNodeTap,
this.onNodeDoubleTap,
this.hoveredPortInfo,
this.backgroundColor,
this.selectedBackgroundColor,
this.borderColor,
this.selectedBorderColor,
this.borderWidth,
this.selectedBorderWidth,
this.borderRadius,
this.padding,
});