0

I am getting an issue how to generate and use the data model classes using json serialisable package in Flutter

{
"listNavigationalCatalogs": {
  "items": [
    {
      "catalogCategories": {
        "items": [
          {
            "categoryTheme": {
              "backgroundColor": {
                "blue": 226,
                "green": 215,
                "red": 163
              },
              "descriptionColor": null,
              "indicatorColor": {
                "red": 54,
                "green": 186,
                "blue": 228
              },
              "selectedColor": null,
              "unSelectedColor": null
            },
            "description": "Adventure Sports",
            "button": {
              "color": {
                "blue": 228,
                "green": 186,
                "red": 54
              },
              "text": "SEE ALL",
              "textColor": null
            },
            "image": "https://i.postimg.cc/pLjSRBvn/adv.jpg",
            "name": "Adventure",
            "priority": 3,
            "_deleted": null
          }
        ]
      },
      "version": 1,
      "interval": 1,
      "fetchedDate": "2021-11-25T00:00Z",
      "fetchRealTime": false,
      "expiryDate": "2021-11-25T00:00Z"
    }
  ]
}

}

I am new to it please help me how to use it I want to get data from all Items -->catalogCategories--> Items --> Names. I am trying to get the data to generate tab bars for my catalogs

1
  • If you get data from API refer my answer here or here or here hope it's helpful to you Commented Nov 26, 2021 at 4:49

1 Answer 1

1

use https://quicktype.io/ and choose dart for json Serialization

Sign up to request clarification or add additional context in comments.

1 Comment

I have all the model but the thing is that I am only getting inside the catalogCatagories items not the overall items. I want Items [catalogCategories] array elements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.