5

底部阴影

嗨,我是新来的颤振,并试图从运球的 Shakuro 创造这个设计。我在尝试为剪裁器创建高程时遇到了麻烦,因为整个矩形正在获取阴影而不是仅剪裁器。

有没有办法在理发器下面放置高程或类似阴影的效果?

4

1 回答 1

10

你可以像这样用形状包裹你的child内部:ContainerCircleBoxDecoration

  new Container(
            height: 300.0,
            width: 300.0,
            child: Center(child: Text("Your child here")),
            decoration: BoxDecoration(
              shape: BoxShape.circle,
              color: Colors.white,
              boxShadow: [
                BoxShadow(
                    color: Colors.grey,
                    blurRadius: 5.0,
                    offset: Offset(5.0, 5.0),
                    spreadRadius: 5.0)
              ],
            ),
          )

结果:

在此处输入图像描述

于 2018-09-02T04:08:02.390 回答