Flutter 如何使用材质设计卡制作阴影?
这是我想要的结果: 制作定制卡Flutter 如何使用材质设计卡制作阴影?,flutter,shadow,Flutter,Shadow,这是我想要的结果: 制作定制卡 盒子阴影是你需要的。我希望这会有所帮助。我知道的两种制作带阴影卡的方法。一个是内置的,另一个是使用 1.使用卡片小部件 SizedBox.expand( child: Card( margin: EdgeInsets.all(10), elevation: 3.0,// this field changes the shadow of the card 1.0 is default
盒子阴影是你需要的。我希望这会有所帮助。我知道的两种制作带阴影卡的方法。一个是内置的,另一个是使用 1.使用卡片小部件
SizedBox.expand(
child: Card(
margin: EdgeInsets.all(10),
elevation: 3.0,// this field changes the shadow of the card 1.0 is default
shape: RoundedRectangleBorder(
side: BorderSide(width: 0.2),
borderRadius: BorderRadius.circular(20)),
),
)
使用容器小部件
修改模糊半径和偏移以改变容器的阴影
你试过卡片或材料吗?
SizedBox.expand(
child: Card(
margin: EdgeInsets.all(10),
elevation: 3.0,// this field changes the shadow of the card 1.0 is default
shape: RoundedRectangleBorder(
side: BorderSide(width: 0.2),
borderRadius: BorderRadius.circular(20)),
),
)
Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
border: Border.all(width: 0.2),
boxShadow: [
BoxShadow(
blurRadius: 2.0,
spreadRadius: 0.4,
offset: Offset(0.1, 0.5)),
],
color: Colors.white),
)