使用,Stack
您可以将图标放置在头像上方以及特定位置。
Stack(
children: [
CircleAvatar(
radius: 75,
backgroundColor: Colors.grey.shade200,
child: CircleAvatar(
radius: 70,
backgroundImage: AssetImage('assets/images/default.png'),
),
),
Positioned(
bottom: 1,
right: 1,
child: Container(
child: Padding(
padding: const EdgeInsets.all(2.0),
child: Icon(Icons.add_a_photo, color: Colors.black),
),
decoration: BoxDecoration(
border: Border.all(
width: 3,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(
50,
),
),
color: Colors.white,
boxShadow: [
BoxShadow(
offset: Offset(2, 4),
color: Colors.black.withOpacity(
0.3,
),
blurRadius: 3,
),
]),
),
),
],
)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句