nodeShapeBuilder property

NodeShape? Function(BuildContext context, Node<T> node)? nodeShapeBuilder
final

Optional builder for determining the shape of a node.

This function is called to determine what shape (if any) should be used for rendering a node. Return null for rectangular nodes.

The shape is used by:

  • The default nodeContainerBuilder to render shaped nodes
  • Connection drawing to calculate correct port positions

Example:

nodeShapeBuilder: (context, node) {
  if (node.type == 'Terminal') {
    return CircleShape(
      fillColor: Colors.green,
      strokeColor: Colors.darkGreen,
      strokeWidth: 2.0,
    );
  }
  return null; // Rectangular node
}

Implementation

final NodeShape? Function(BuildContext context, Node<T> node)?
nodeShapeBuilder;