简体   繁体   中英

How can display this response of Image URL in Flutter?

This is the response of ImageList i have.

How Can i display this postURL array in UI, may be image.network with Builder like GridView or ListView 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.

Please Help friends.

Once you get the response from the API, you would store it as a list. Then update the UI through list iterable with flutter NetworkImage widget.

The image you are trying to display you image in column

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM