highlight<T> static method

Widget Function(TreeNode<T> node) highlight<T>(
  1. Widget nodeBuilder(
    1. TreeNode<T>
    )
)

高亮边框样式

为拖拽节点添加蓝色边框和半透明背景,突出显示拖拽状态

示例:

TolyDraggableTree(
  dragFeedbackBuilder: DragFeedbacks.highlight<MyData>(_buildNode),
  // ...
)

Implementation

static Widget Function(TreeNode<T> node) highlight<T>(
    Widget Function(TreeNode<T>) nodeBuilder) {
  return (node) => Container(
        decoration: BoxDecoration(
          color: Colors.blue.withOpacity(0.1),
          border: Border.all(color: Colors.blue, width: 2),
          borderRadius: BorderRadius.circular(4),
        ),
        child: nodeBuilder(node),
      );
}