gpt4 book ai didi

image - Flutter web 图像在移动 View 中加载,但不是在全 View 中?

转载 作者:行者123 更新时间:2023-12-05 08:15:55 26 4
gpt4 key购买 nike

我正在使用 FadeInImage 小部件从网络加载图像

当从开发人员控制台在移动 View 中刷新页面时,图像加载正常,但在完整 View 中它给了我一个异常

The following ImageCodecException was thrown resolving an image codec:
Failed to load network image.
Image URL: https://api.gogoz.in/static/img/FF000001FV0000007.jpg
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://api.gogoz.in/static/img/FF000001FV0000007.jpg", scale: 1)
Image key: NetworkImage("https://api.gogoz.in/static/img/FF000001FV0000007.jpg", scale: 1)

最佳答案

问题:

似乎在最新的 Beta 版本 1.26(2021 年 2 月)中,默认的 renderer 似乎已从 html 切换到 canvaskit .

修复:

Web 中工作时,使用 html 渲染器而不是 canvaskit。这是这样的:

  • 如果您从命令行“运行”,请使用:

flutter run -d chrome --web-renderer html

  • 如果您使用 Android Studio:转到 Run/Run.../Edit Configurations.../,然后在 Additional arguments 中添加此 --网页渲染器 html.

关于image - Flutter web 图像在移动 View 中加载,但不是在全 View 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66060984/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com