I wanna create, in my Profile Screen, an user's profile photo rounded with a button, or a something creative to change this photo like google:

But what I have now is this:
CircleAvatar(
radius: 75,
backgroundColor: Colors.grey.shade200,
child: CircleAvatar(
radius: 70,
backgroundImage: AssetImage('assets/images/default.png'),
)
),
How can I add a button like in the google example?
Using Stack you can put icon on top of the avatar and at a specific position.
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,
),
]),
),
),
],
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With