0

I got avif image from server but image not showing.

I have tried Image.network() and CachedNetworkImage to show avif image .

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)
Jewel Rana
  • 2,397
  • 1
  • 19
  • 28

2 Answers2

0

You can convert the image, while this is format is not supported.

The following image formats are supported: JPEG, PNG, GIF, Animated GIF, WebP, Animated WebP, BMP, and WBMP.

For more, read Image-class

Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
0

Here is a Flutter library that is capable of decoding and encoding AVIF photos.

https://github.com/yekeskin/flutter_avif

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/32787561) – user16217248 Sep 28 '22 at 21:00