How do I crop an image in Flutter?

后端 未结 5 1107
长发绾君心
长发绾君心 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

    You can also directly use the Image class with BoxFit and do something like:

    new Image.asset(
      stringToImageLocation,
      fit: BoxFit.cover,
    )
    

提交回复
热议问题