首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >颤动: JSON循环

颤动: JSON循环
EN

Stack Overflow用户
提问于 2018-08-27 15:53:29
回答 2查看 20.4K关注 0票数 12

我在Flutter中有一个Json解析项目,Json如下所示:

代码语言:javascript
复制
{
  "Dependents":[
      {
        "Name": "Kim",
        "Relationship": "Parent",
        "Entitlements": [
            {
              "GP": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "OPS": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "IP": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "Dental": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "Optical": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "Maternity": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            }
        ]
      },
      {
        "Name": "Tim",
        "Relationship": "Spouse",
        "Entitlements": [
            {
              "GP": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "OPS": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "IP": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "Maternity": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            }
        ]
      },
      {
        "Name": "Lim",
        "Relationship": "Child",
        "Entitlements": [
            {
              "GP": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "OPS": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "Dental": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "Optical": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "Maternity": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            }
        ]
      },
      {
        "Name": "Xim",
        "Relationship": "Child",
        "Entitlements": [
            {
              "GP": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "OPS": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            },
            {
              "IP": {
                "Entitlement": "10000",
                "Utilisation": "500",
                "Balance": "9500"
              }
            }
        ]
      }
    ]
}

如您所见,在Dependents下有多个用户,而在这些用户下,他们有自己的授权

我目前遇到的问题是:

由于每个用户都有不同的授权与之关联,我该如何遍历授权以打印出其下的所有地图。

敬请协助。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52034895

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档