nodeBuilder property
Builder function that creates a widget for each visible tree node.
nodeKey is the node's unique identifier and nodeDepth its nesting
level, 0 for roots.
Use TreeController.getNodeData to look up the node's data payload.
Variable-height rows are supported. The cost is that a row carries no measured extent until it has been laid out once, so any offset derived for rows that have never been on screen uses an estimate and is corrected once the real heights arrive.
Every row shares ONE BuildContext, the sliver's own element, so an inherited read here registers against that element rather than against the row. A change to any inherited widget any row reads therefore dirties every mounted row, and the next layout rebuilds the cache-region and sticky rows it reaches. Reading a high-frequency inherited value in a row builder costs one queue plus one layout per notification.
Implementation
final Widget Function(BuildContext context, TKey nodeKey, int nodeDepth)
nodeBuilder;