我想做这样的布局,图像周围有阴影:
我用一个容器围绕图像,用一个BoxDecoration来画阴影。当列收缩时,图像应调整大小。
但阴影不会随图像调整大小:
有人能帮帮我吗
下面是我的代码:
Column(mainAxisAlignment: MainAxisAlignment.center, children: [
Text(...)
),
]),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0),
child: Container(
decoration: BoxDecoration(
border: Border.all(width: 2.0),
boxShadow: [
BoxShadow(
color: Color.fromARGB(255, 0, 0, 0),
spreadRadius: 0,
blurRadius: 0,
offset: Offset(5, 5),
),
],
),
child: Image.asset("images/myimage.png")),
)),
Text("..."),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(...),
IconButton(...),
],
),
],
),
1条答案
按热度按时间dgenwo3n1#