![](/img/trans.png)
[英]Using JSON, display all images into UICollectionView from web directory
[英]How to Display All the Images from Json Data into Carousal using Flutter
您可以將 carousel_slider 用於輪播,對於圖像,您可以使用 Image.network 或 Cached network image
您應該始終嘗試在您的問題中包含您已經嘗試過的內容以及您面臨的具體問題,但是這是一個非常簡單的答案,所以這里是如何做到這一點的要點。
您可以使用 http package 和get
請求來獲取原始 API 數據。 一旦你有了這個,你可以使用jsonDecode(String data)
來解碼它,它返回一個Map<String, dynamic>
。 You can then select the list field as in any map object ( jsonMap['images']
) and use the list .map
method to create a list of Image.network
widgets to use as the children
in you carousel package of choice (or build你自己)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.