I’m unable to create clubhose avatar in flutter because the image widget background is dynamic or video , so i’m try to use clubhose avatar as blue print and then clipping with the new dynamic image from api .
here is my code :
Container(
height: height,
width: width,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.elliptical(width / 3 * 1.4, width / 3 * 1.6),
),
// color: mainColor,
image: decorationImage ??
DecorationImage(image: AssetImage(unknown_person))),
child: child ?? SizedBox(),
);
this was i wanted without black border .
this what i got :
2
Answers
To round corners, there’s a special Widget for that –
ClipRRect
:To make an elliptical shape, you specify the
Radius.elliptical
constructor (as you have already done):Use Container with
clipBehaviour
property and give radius to every corner according to your need like thisthis what you will got