无法在已构建的Flutter Web应用中显示网络图片。

huangapple go评论56阅读模式
英文:

Unable to show a network image in a Built Flutter web app

问题

我的图像都托管在阿里云,我可以在本地开发模式下成功显示图像,但在Web构建中无法显示图像。

以下是图像链接和代码:

https://chilleasy-image.oss-cn-hongkong.aliyuncs.com/prod/img/24/badabcd5a5df790bd70daed4e7db15fe.jpg

Container(
  child: Image.network(
            ImageList[index].image_path,
            fit: BoxFit.contain),
),

有什么想法?

英文:

My images are all hosted in AliCloud, I can show the image successfully in local developing mode, but failed to display the image in a web build.

Here is the image link and the code:

https://chilleasy-image.oss-cn-hongkong.aliyuncs.com/prod/img/24/badabcd5a5df790bd70daed4e7db15fe.jpg

Container(
  child: Image.network(
            ImageList[index].image_path,
            fit: BoxFit.contain),
),

Any ideas?

答案1

得分: 4

Sure, here is the translation:

使用HTML渲染器:

flutter build web --release --web-renderer html

或者

flutter run --web-renderer html

英文:

use html renderer:

flutter build web --release --web-renderer html

or

flutter run --web-renderer html

huangapple
  • 本文由 发表于 2023年4月19日 18:28:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76053424.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定