[英]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.