感觉好像我遗漏了一些显而易见的东西,但这段代码在我的图像周围创建了一个可爱的边框:
Widget buildImageWithBorder(String imageUrl) {
return Container(
height: 240.0,
width: 222.0,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage(imageUrl),
fit: BoxFit.cover,
),
color: Colors.white,
border: Border.all(color: Colors.white, width: 4.0),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(16.0),
bottomRight: Radius.circular(16.0),
),
),
);
}
并将边界设置为使用4
BorderSide
s也适用:
border: Border(
left: BorderSide(
color: Colors.white,
width: 4.0,
),
right: BorderSide(
color: Colors.white,
width: 4.0,
),
bottom: BorderSide(
color: Colors.white,
width: 4.0,
),
top: BorderSide(
color: Colors.white,
width: 4.0,
),
),
但如果我把
边线
s(我要完全删除的是
top
),或更改
边线
到
0.0
(即只有3个边框),没有边框显示。我怎样才能得到三个边界(边界半径)?