Flutter:ClipOval 剪刀高度
Flutter: ClipOval clipper elevation
Bottom Shadow
你好,我是 flutter 的新手,正在尝试从 shakuro of dribble 创建这个设计。我在尝试为裁剪器创建高程时遇到了麻烦,因为整个矩形都在获取阴影,而不仅仅是裁剪器。
有没有办法在裁剪器下方添加高度或类似阴影的效果?
您可以将 child
包裹在 Container
中,在 BoxDecoration
中使用 Circle
形状,如下所示:
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)
],
),
)
结果:
Bottom Shadow
你好,我是 flutter 的新手,正在尝试从 shakuro of dribble 创建这个设计。我在尝试为裁剪器创建高程时遇到了麻烦,因为整个矩形都在获取阴影,而不仅仅是裁剪器。
有没有办法在裁剪器下方添加高度或类似阴影的效果?
您可以将 child
包裹在 Container
中,在 BoxDecoration
中使用 Circle
形状,如下所示:
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)
],
),
)
结果: