Home > database >  BoxFit.fill shrinks the image,while BoxFit.Cover leads to hide some parts of the image
BoxFit.fill shrinks the image,while BoxFit.Cover leads to hide some parts of the image

Time:09-05

Ima trying to use an image in a circular shape, but it always leads to the issue of either cutting parts at the edge of the image, or shrinking the image in a bad way that is not good for the design...Have used DecorationImage, CircleAvatar, and ClipOval and all of them lead to the same issue. in case of boxFit.Cover

in case of boxFit.Fit

CodePudding user response:

Because you have issue with your image's width, you can use BoxFit.fitWidth. This would fit image from its width and cut it from its height.

CodePudding user response:

Use BoxFit.contain to keep the aspect ratio of the image and not cut out parts. It's like the combination of BoxFit.width and BoxFit.height.

  • Related