小编Gon*_*pez的帖子

如何在 Flutter 中映射具有相同类型嵌套对象的 json?

我需要在 Flutter 中映射这个 json,我尝试使用 fromMap of JsonCodec 但抛出 StackOverflowError。任何建议将非常受欢迎。

{
"items": [
    {
        "id": 59,
        "name": "Trastornos de la glándula tiroides",
        "parent": {
            "id": 58,
            "name": "Enfermedades endócrinas",
            "parent": null,
            "diagnosis_classifications": {
                "count": 1,
                "items": [
                    {
                        "id": 58,
                        "name": "CIE-10 Diagnósticos",
                        "code": "E00-E35"
                    }
                ]
            }
        },
        "diagnosis_classifications": {
            "count": 1,
            "items": [
                {
                    "id": 59,
                    "name": "CIE-10 Diagnósticos",
                    "code": "E00-E07"
                }
            ]
        }
    }
]
Run Code Online (Sandbox Code Playgroud)

}

json dart flutter

2
推荐指数
1
解决办法
4271
查看次数

标签 统计

dart ×1

flutter ×1

json ×1