build method

  1. @override
Widget build(
  1. BuildContext context,
  2. List<TreeNodeDepth> depth,
  3. int index
)
override

Builds the visual representation of branch lines for a tree node.

Creates a widget that shows the connection lines between tree nodes based on the node's position in the hierarchy and its depth information.

Parameters:

  • context (BuildContext): Build context for theme access
  • depth (List
  • index (int): Index within the current depth level

Returns: A Widget representing the branch line visualization

Implementation

@override
Widget build(BuildContext context, List<TreeNodeDepth> depth, int index) {
  if (index <= 0) {
    return const SizedBox();
  }
  return CustomPaint(
    painter: _PathPainter(
      color: color ?? Theme.of(context).colorScheme.border,
      top: true,
      bottom: true,
    ),
  );
}