【问题标题】:avif image format not supported in flutterFlutter 不支持 avif 图像格式
【发布时间】:2021-11-05 18:29:09
【问题描述】:

我从服务器获得了 avif 图像,但图像没有显示。

我试过 Image.network()CachedNetworkImage 来显示 avif 图像。

Exception: Invalid image data

When the exception was thrown, this was the stack: 
#0      _futurize (dart:ui/painting.dart:5326:5)
#1      ImageDescriptor.encoded (dart:ui/painting.dart:5194:12)
#2      instantiateImageCodec (dart:ui/painting.dart:2048:60)
<asynchronous suspension>
Image provider: NetworkImage("https://www.soppiya.com/media/images/610fc7bb172b28ecf8655216/item/6122493b75ca8186640a03ae/image1.avif?x=62433", scale: 1.0)
Image key: NetworkImage("https://www.soppiya.com/media/images/610fc7bb172b28ecf8655216/item/6122493b75ca8186640a03ae/image1.avif?x=62433", scale: 1.0)

【问题讨论】:

    标签: flutter dart image-formats avif


    【解决方案1】:

    您可以转换图像,但不支持这种格式。

    支持以下图像格式:JPEG、PNG、GIF、动画 GIF、WebP、动画 WebP、BMP 和 WBMP。

    更多信息,请阅读Image-class

    【讨论】:

      猜你喜欢
      • 2021-12-20
      • 1970-01-01
      • 1970-01-01
      • 2016-07-28
      • 2019-06-09
      • 2012-05-15
      • 1970-01-01
      • 1970-01-01
      • 2014-08-04
      相关资源
      最近更新 更多