0

I am trying to fetch JSON Object which has 2 list object with the same name, but has a different value. The object list named "items", the first "items" has "products_title,product_image,link", and the second "items" has "article_title, article_image,link". How to write PODO ?

I've been trying to writes PODO, but even i try to change the model, it still does not work. I try the other REST API, for the example "https://jsonplaceholder.typicode.com/pothos" its working fine. But if i try used my JSON its getting error, i wonder how to write PODO ?

this is the JSON i am using :

{
"data": [
    {
        "section": "electronics",
        "items": [
            {
                "product_name": "Cellphone",
                "product_image": "cellphoneImage.png",
                "link": "https://cellphone.html"
            },
        ]
    },
    {
        "section": "facts",
        "section_title": "Title section",
        "items": [
            {
                "article_title": "Facts",
                "article_image": "https://www.facts.png",
                "link": "https://www.facts.html"
            },
        ]
    }
]

}

  • check the post I wrote : https://medium.com/@diegoveloper/flutter-fetching-parsing-json-data-c019ddddaa34 – diegoveloper Jun 27 '19 at 06:53
  • yes i have check your post for reference. i thought the JSON is different, "https://jsonplaceholder.typicode.com/pothos" is more simple than JSON i try to fetch. i also already try using jsonplaceholder and its working fine. – Yusril Dewantara Jun 27 '19 at 06:59

0 Answers0