【发布时间】:2024-05-19 17:25:01
【问题描述】:
这是我在 Android Studio 中加载一个 GIF 的 Flutter 代码:
Image.network(
'https://flutter-examples.com/wp-content/uploads/2021/01/happy_mothers_Day.gif',
width: 300,
height: 400,
fit: BoxFit.contain,
)
但我总是收到这样的错误:
======== Exception caught by image resource service ================================================
The following ImageCodecException was thrown resolving an image codec:
Failed to load network image.
Image URL: https://flutter-examples.com/wp-content/uploads/2021/01/happy_mothers_Day.gif
Trying to load an image from another domain? Find answers at:
https://flutter.dev/docs/development/platform-integration/web-images
When the exception was thrown, this was the stack:
Image provider: NetworkImage("https://flutter-examples.com/wp-content/uploads/2021/01/happy_mothers_Day.gif", scale: 1)
Image key: NetworkImage("https://flutter-examples.com/wp-content/uploads/2021/01/happy_mothers_Day.gif", scale: 1)
====================================================================================================
谁能帮我解决这个问题?提前致谢!
【问题讨论】:
-
你在哪里测试这个 GIF?我的意思是网络/安卓...?
-
我正在通过 chrome 测试 Web
-
提供渲染选项,希望能解决,你可以在下面查看我的答案