shadow<T> static method

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

简单阴影样式

为拖拽节点添加白色背景和阴影效果,适合大多数场景

示例:

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

Implementation

static Widget Function(TreeNode<T> node) shadow<T>(
    Widget Function(TreeNode<T>) nodeBuilder) {
  return (node) => Container(
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(4),
          boxShadow: [
            BoxShadow(
              color: Colors.black.withOpacity(0.2),
              blurRadius: 8,
              offset: const Offset(0, 4),
            ),
          ],
        ),
        child: nodeBuilder(node),
      );
}