BoxDecoration({
this.color, // 颜色
this.image, // 图片
this.border, // 边框
this.borderRadius, // 圆角 和 shape不能同时用
this.boxShadow, //
this.gradient,
this.backgroundBlendMode,
this.shape = BoxShape.rectangle, // 形状
})
Demo
![](https://img.haomeiwen.com/i9403487/b105afa8bb7c0ec9.png)
截屏2020-05-13 上午11.45.33.png
return Container(
width: 200,
height: 200,
decoration: BoxDecoration(
border: Border.all(
width: 30,
color: Colors.red
),
// borderRadius: BorderRadius.circular(10.0),
boxShadow: [
BoxShadow(
color: Colors.amber,
blurRadius: 5.0,
),
BoxShadow(
color: Colors.green,
blurRadius: 10.0,
offset: Offset(3.5, 12)
)
],
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage("https://img2.woyaogexing.com/2020/05/13/f74a273d69884ed9a5d8f73b5376fcdf!400x400.jpeg"),
fit: BoxFit.fitHeight
)
),
);
网友评论