Gurjit Singh
Gurjit Singh

Reputation: 171

How to get data using Flutter from api using Json Serializable

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

Upvotes: 0

Views: 453

Answers (1)

Lakshydeep Vikram Sah
Lakshydeep Vikram Sah

Reputation: 39

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

Upvotes: 1

Related Questions