简体   繁体   English

如何在 Flutter 中显示图像 URL 的此响应?

[英]How can display this response of Image URL in Flutter?

This is the response of ImageList i have.这是我对 ImageList 的回应。

How Can i display this postURL array in UI, may be image.network with Builder like GridView or ListView Builder.我如何在 UI 中显示这个 postURL 数组,可能是 image.network 和像 GridView 或 ListView Builder 这样的 Builder。

 "postUrl": [
            "https://uat-marc.s3.ap-south-1.amazonaws.com/news-feed/265_0.jpg",
            "https://uat-marc.s3.ap-south-1.amazonaws.com/news-feed/265_1.JPG",
            "https://uat-marc.s3.ap-south-1.amazonaws.com/news-feed/265_2.PNG",
            "https://uat-marc.s3.ap-south-1.amazonaws.com/news-feed/265_3.PNG"
        ],

If implemented all model and try to display it, but i am getting some codec and not valid error.如果实现了所有 model 并尝试显示它,但我得到一些编解码器并且无效错误。

Please Help friends.请朋友帮忙。

Once you get the response from the API, you would store it as a list.从 API 获得响应后,您会将其存储为列表。 Then update the UI through list iterable with flutter NetworkImage widget.然后使用 flutter NetworkImage 小部件通过可迭代的列表更新 UI。

The image you are trying to display you image in column您尝试在列中显示的图像

Column(
  children: postUrl.map((url) => NetworkImage(url: url)).toList(),
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在flutter中用URL显示图片 - How to display image with URL in flutter Flutter:如何优先显示来自 Asset 的图像,如果找不到,则显示来自 URL 的图像? - Flutter: How to prioritize displaying the image from Asset, if it can't be found, then display image from URL? 如何在 flutter 中显示来自 api 响应的 png 图像? - How to display a png image from api response in flutter? 如何在 flutter 中显示来自 API 响应的图像 - How to display image which comes from API response in flutter API 响应图像 URL 在颤动中不显示图像 - API Response image URL not displaying image in flutter 如何使用 flutter 和 firebase 在 Firestore 中使用 URL 作为字符串在 App 中显示图像 - How to display Image in App with flutter and firebase using URL as String in Firestore 如何在 flutter 中显示基于 http 响应的按钮 - How can i display a button based on http response in flutter 如何获得响应的 URL? 在 Flutter - How to get the URL of the response? in Flutter 如何将图像 url 链接到另一个 url 以显示有关 flutter 中第一个 url 的一些信息? - How does one link an image url to another url to display some information about the first url in flutter? 如何从 Flutter 中的字节数据显示图像 - How can I display image from byte data in Flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM