i am trying to center a circular avatar on the SCREEN and next to it an icon button.
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircleAvatar(
radius: 35,
backgroundColor: Colors.grey[400],
backgroundImage: NetworkImage(_userInfo!.profileImageUrl),
),
IconButton(onPressed: editProfile, icon: Icon(Icons.edit),),
],
),
i tried using "align" it did not work
2
Answers
To center the
CircleAvatar
on the screen, theres’s widget for that!Use
Center
:You can use the row property in your tree widget instead of the extra cost of creating an additional widget Like this :