Flutter实现圆角图片、Flutter实现图片圆角
要在Flutter中实现圆角图片可以结合容器Container来实现。
Flutter实现圆角图片的话,首先需要给Container设置宽度高度,然后配置Container圆角,最后在Container中包裹image组件就可以实现
Flutter实现圆角图片完整代码
return Center(
child: Container(
width: 300.0,
height: 300.0,
decoration: BoxDecoration(
color: Colors.yellow,
borderRadius: BorderRadius.circular(150),
image: DecorationImage(
image: new NetworkImage('https://www.itying.com/images/201905/thumb_img/1101_thumb_G_1557845381862.jpg'),
fit: BoxFit.cover
)
),
),
);