【发布时间】:2020-12-07 13:25:17
【问题描述】:
我有一个简单的程序,它显示图像 URL 的图像:
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(itemList[itemIndex].name),
),
body: Image.network(
"https://images.pexels.com/photos/462118/pexels-photo-462118.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"));
}
使用这些网址:
https://picsum.photos/250?image=9
例如,它可以正常工作。但是
https://img.kitapyurdu.com/v1/getImage/fn:11262922/wh:true/wi:0/mh:150
和
https://img.kitapyurdu.com/v1/getImage/fn:11250623/wh:fca476ca7
图像不显示。为什么会发生这种情况,我该如何解决?
【问题讨论】:
-
第二个网址中图片的文件类型是什么?
-
如果您的意思是 .png 或 .jpg,我不知道。我只是想获取图像。这有关系吗?
-
是的,如果你存储的文件类型是 .svg,这很重要
-
我检查了你的网址,它正在工作,检查你的互联网连接