我有以下从服务器获取的 JSON 数据,我需要在 pageviewbuilder 以及 Flutter 应用程序中的 listview builder 中获取和配置这些数据。
Listview builder(垂直滚动)嵌套在 Pageview builder(水平滚动)中,我已经配置了
要展示的东西是这样的
页面 ---------- 订购商品
订单 16 >> 订单 16,项目 1 ,订单 16 项目 2
订单 18 >> 订单 18,项目 1,订单 18,项目 2,订单 18,项目 3
我是在flutter中学习JSON的新手,请指导我如何获取数据并根据需要用于上述配置。
{
"error": "false",
"content": [
{
"comp_code": "4",
"comp_name": "KMT OVERSEAS",
"order_no": "16",
"soh_pk": "23660",
"order_items": [
{
"comp_code": "4",
"comp_name": "KMT OVERSEAS",
"order_no": "16",
"sod_pk": "31689",
},
{
"comp_code": "4",
"comp_name": "KMT OVERSEAS",
"order_no": "16",
"sod_pk": "31688",
}
]
},
{
"comp_code": "4",
"comp_name": "KMT OVERSEAS",
"order_no": "18",
"soh_pk": "23702",
"order_items": [
{
"comp_code": "4",
"comp_name": "KMT OVERSEAS",
"order_no": "18",
"sod_pk": "31749",
},
{
"comp_code": "4",
"comp_name": "KMT OVERSEAS",
"order_no": "18",
"sod_pk": "31742",
},
{
"comp_code": "4",
"comp_name": "KMT OVERSEAS",
"order_no": "18",
"sod_pk": "31743",
},
]
}
]
}