You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we want to use CircleAvatar to represent user accounts with profile pictures, we need to have a way to clip images passed to CircleAvatar as a child. Right now, it does no clipping so you would need to passed a clipped image inside.
Clipping the child isn't efficient and currently we don't antialias the circular clip. I think that a better option would be to give CircleAvatar a backgroundImage attribute which would just be passed along to the BoxDecoration that's already being created. The backgroundImage will be rendered correctly vis the backgroundColor and the child and it will be rendered efficiently.
The docs for CircleAvatar should mention that if an arbitrary widget child is specified, rather than a Text(singleInitialCharacter), you'll want to wrap it with ClipOval if it's possible that it will overflow.
That makes sense, but are profile pictures already circles on Android for example? If not, ClipOval might be necessary for all profile pictures, so it might be a good idea to have an easy way to just use them without worrying about making them circles.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
HansMuller commentedon Jul 19, 2016
Clipping the child isn't efficient and currently we don't antialias the circular clip. I think that a better option would be to give CircleAvatar a backgroundImage attribute which would just be passed along to the BoxDecoration that's already being created. The backgroundImage will be rendered correctly vis the backgroundColor and the child and it will be rendered efficiently.
The docs for CircleAvatar should mention that if an arbitrary widget child is specified, rather than a Text(singleInitialCharacter), you'll want to wrap it with ClipOval if it's possible that it will overflow.
dragostis commentedon Jul 19, 2016
That makes sense, but are profile pictures already circles on Android for example? If not,
ClipOvalmight be necessary for all profile pictures, so it might be a good idea to have an easy way to just use them without worrying about making them circles.abarth commentedon Jul 19, 2016
A backgroundImage with shape of BoxCircle will be a circle. It's just a more efficient way to clip the image.
Roll engine to ed303c6 (dart roll)
github-actions commentedon Sep 6, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.