实现圆形头像的效果有三种,喜欢哪种用哪种
(1)ClipOval
new ClipOval(
child:new Image.asset("assets/image/a.png");
)
(2)CircleAvatar
new CircleAvatar (
radius:30.0,
backgroundImage:AssetImage("assets/image/a.png"),
)
(3)BoxDecoration BoxShape.circle
Container(
width:72.0,
height:72.0,
decoration:BoxDecoration(
shape:BoxShape.circle,
image:DecorationImage(
image:AssetImage("assets/images/a.png"),
)
)
)
效果:
仅供学习使用