How do I crop an image in Flutter?

后端 未结 5 1109
长发绾君心
长发绾君心 2020-12-03 03:09

Let\'s say I have a rectangular, portrait image:

I\'d like to crop it, such that it\'s rendered like this:

How can I do this in Flutter?

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-03 03:59

    There is a new package called ImageCropper. I would recommend everyone to use this instead as it has many features and makes everything easier. It allows you to crop the image to any or specified aspect ratio you want and can even compress the image. Here is the link to the package: https://pub.dev/packages/image_cropper

提交回复
热议问题