I am using CicleAvatar to show my avatar but it is not showing circular shape. Here is my code
//Circle Image
Widget circularImage(){
return new CircleAvatar(
radius: 45,
child: CachedNetworkImage(
imageUrl: this.strImageURL,
placeholder: new CircularProgressIndicator(),
errorWidget: new Icon(Icons.error),
)
);
}
You can wrap your cachedNetworkImage in ClipRRect widget like this:
Widget circularImage(){
return CircleAvatar(
radius: 45,
child: ClipRRect(
borderRadius: BorderRadius.circular(45),
child: CachedNetworkImage(
imageUrl: this.strImageURL,
placeholder: new CircularProgressIndicator(),
errorWidget: new Icon(Icons.error),
),
),
);
}
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