Сложная обработка json-карт во флаттере

Как решить этот тип сложной карты структурированного ответа JSON api во флаттере? Я уже просматривал документы, указанные на https://flutter.dev/, также смотрю https://app.quicktype.io/

{
"results": [
    {
        "foodId": "927",
        "foodName": "Meals",
        "foodDescription": "Meals is a feast encompassing the length and breadth of vegetarian cuisine",
        "foodOfferPrice": "95.00",
        "foodDisplayPrice": "95.00",
        "foodCategory": "South Indian",
        "foodThumb": "http://demourl.com/app/uploads/foods/c85d4fd51ee9c5632ba34e160cdab33e.png",
        "foodImage": "http://demourl.com/app/uploads/foods/67198950a93f397c1612ea9f9984db51.png",
        "foodVariants": [
            {
                "foodVariantId": "965",
                "foodVariantType": "One Set",
                "foodVariantPrice": "95.00"
            }
        ],
        "relatedFoods": [
            {
                "foodId": "1016",
                "foodName": "Appam",
                "foodThumb": "http://foodoyes.com/app/uploads/foods/71de15dd48566732ca086dfcf78236b3.png",
                "foodOfferPrice": "10.00",
                "foodDisplayPrice": "10.00",
                "foodCategory": "South Indian"
            },
            {
                "foodId": "929",
                "foodName": "Ghee Rice",
                "foodThumb": "http://foodoyes.com/app/uploads/foods/14a6ccaea3870fb87358a6e39aa58f6a.png",
                "foodOfferPrice": "92.00",
                "foodDisplayPrice": "92.00",
                "foodCategory": "South Indian"
            },

        ]
    },
    ]
    "status": 1,
"message": ""
    }

1 ответ

Вы можете использовать json_serializable. Других хороших вариантов я не знаю.

Другие вопросы по тегам