Search
[Flutter/dart]Crop the image into an oval
- M.R

- Oct 9, 2021
- 1 min read
Overview
When displaying an image on a smartphone app, I think that the original image is often cropped and displayed.
If you want to crop in a circle, you use CircleAvator, but if the original image is vertically long, you may want to crop it in an oval shape. I will explain how to do it.
Method
Use ClipOval.
Widget _myImg(){
return ClipOval(
child: Image.asset('image/rect.png',),
);
}@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Column(
children: [
Center(
child: _myImg()
)
],
),
);
}original image:

this becomes like below.







Comments