如何使用DecorationImage中的FileImage压缩或更改图像质量?

时间:2019-05-05 10:00:03

标签: dart flutter

我正在创建一个应用程序,其中使用了一些DecorationImage。我的图像的显示速度确实很慢,有时在ListView中闪烁。有没有办法压缩它们?

我知道Image.file上有该参数,但不能在DecorationImage小部件中使用。

child : Container(
          height: 350.0,
          decoration: BoxDecoration(
            image: DecorationImage(
              image: FileImage(File(item.image)),
              alignment: Alignment.topCenter,
              fit: BoxFit.cover
            ),

0 个答案:

没有答案