圆形头像
ClipOval
new ClipOval(
child: new Image.asset('images/header.png'),
)
CircleAvatar
new CircleAvatar(
radius: 36.0,
backgroundImage: AssetImage(
'images/header.png',
),
)
BoxDecoration BoxShape.circle
new Container(
width: 72.0,
height: 72.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(
'images/header.png',
),
),
),
)
圆角头像
ClipRect
new ClipRect(
borderRadius: BorderRadius.circular(6.0),
child: new Image.asset('images/header.png'),
)
BoxDecoration BoxShape.rectangle
new Container(
width: 88.0,
height: 88.0,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(6.0),
image: DecorationImage(
image: AssetImage(
'images/header.png',
),
),
),
Copy:Flutter 圆形/圆角头像
网友评论