insertedNode<Data, Tree extends ITreeNode<Data>> static method

Widget insertedNode<Data, Tree extends ITreeNode<Data>>({
  1. required int index,
  2. required Tree node,
  3. required TreeNodeWidgetBuilder<Tree> builder,
  4. required AutoScrollController scrollController,
  5. required Animation<double> animation,
  6. required ExpansionIndicatorBuilder<Data>? expansionIndicator,
  7. required ValueSetter<Tree>? onItemTap,
  8. required ValueSetter<Tree> onToggleExpansion,
  9. required bool showRootNode,
  10. required Indentation indentation,
  11. required LastChildCacheManager lastChildCacheManager,
})

Implementation

static Widget insertedNode<Data, Tree extends ITreeNode<Data>>({
  required int index,
  required Tree node,
  required TreeNodeWidgetBuilder<Tree> builder,
  required AutoScrollController scrollController,
  required Animation<double> animation,
  required ExpansionIndicatorBuilder<Data>? expansionIndicator,
  required ValueSetter<Tree>? onItemTap,
  required ValueSetter<Tree> onToggleExpansion,
  required bool showRootNode,
  required Indentation indentation,
  required LastChildCacheManager lastChildCacheManager,
}) {
  return ValueListenableBuilder<INode>(
    key: ValueKey(node.key + index.toString()),
    valueListenable: node,
    builder: (context, treeNode, _) => ValueListenableBuilder(
      valueListenable: (treeNode as Tree).listenableData,
      builder: (context, data, _) => ExpandableNodeItem<Data, Tree>(
        builder: builder,
        scrollController: scrollController,
        node: node,
        index: index,
        animation: animation,
        indentation: indentation,
        expansionIndicatorBuilder: expansionIndicator,
        onToggleExpansion: onToggleExpansion,
        onItemTap: onItemTap,
        showRootNode: showRootNode,
        lastChildCacheManager: lastChildCacheManager,
      ),
    ),
  );
}