给定 json 响应如何使用 dio 在 list flutter 中绑定?
given json response how to binding in list flutter using dio?
{
“成功”:真实,
“数据”: [
{
“编号”:11,
"order_ref_no": "OA-1624432086",
"customer_id": 1,
"customer_address_id": 1,
"order_date": "2021-06-23",
"delivery_date": "2021-06-27",
"delivery_time_from": "12:00:00",
"delivery_time_to": "14:00:00",
"sub_total": 679,
"delivery_charges": 22,
"order_total": 701,
"order_status": "完成",
“顾客”: {
“编号”:1,
“照片”:“https://drive.google.com/uc?id=17nPK4ChZG1Pv7hkYI0MN2ZYsjj646yI7&export=media”,
"first_name": "维沙尔",
"last_name": "夏尔马",
"email": "vishal@gmail.com",
"手机": "+91 1111111111",
"dob": "2021-06-17",
"mobile_verified": "真",
“fcm_token”:空,
“纬度”:空,
“经度”:空,
“状态”:“活跃”,
"created_at": "2021-06-17 05:35:51",
"updated_at": "2021-06-23 10:28:00"
},
“customer_address”:{
“编号”:1,
"customer_id": 1,
"address_type": "办公室",
"receiver_name": "megha",
"receiver_contact_number": "9632589632",
"state_id": 1,
“区域”:“尼科尔”,
“密码”:382350,
"house_no": "c-122",
"city_id": 2,
"address_1": "奉爱圈",
"address_2": "印度古吉拉特邦艾哈迈达巴德",
“纬度”:“23.1218578”,
“经度”:“72.545334”,
"created_at": "2021-06-17 10:07:36",
"updated_at": "2021-06-23 07:06:04",
“deleted_at”:空
},
“order_invoice”:[
{
“编号”:10,
"order_id": 11,
"vendor_id": 8,
"delivery_boy_id": 1,
"invoice_ref_no": "INV-16244320863",
“总数”:199,
"admin_commission": 0,
"invoice_total": 199,
“状态”:“已交付”,
"created_at": "2021-06-23 07:08:06",
"updated_at": "2021-06-23 13:17:42",
“vendor_data”:{
“编号”:8,
"vendor_image": "https://drive.google.com/uc?id=1sLdbAUjb9TbVUX6yxdZ6qbMi9EDUbjkf&export=media",
"vendor_name": "蔬菜店",
"employee_name": "斯里坎特",
"dob": "1980-06-17",
"admin_share": "2",
“手机”:“+91 9292929292”,
"email": "sri@gmail.com",
"city_id": 1,
"delivery_range": "2",
"is_best_seller": 1,
"is_trending": 1,
“纬度”:“19.6641°”,
“经度”:“78.5320°”,
“fcm_token”:空,
"vendor_address": "靠近海德街",
“start_time”:空,
“end_time”:空,
“time_interval”:空,
"created_at": "2021-06-17 12:29:48",
"updated_at": "2021-06-17 12:29:48",
"vendor_status": "在线",
“状态”:“活跃”,
“mobile_verified”:“假”
},
“order_invoice_items”:[
{
“编号”:25,
"invoice_id": 10,
"vendor_id": 8,
"product_id": 6,
"product_name": "鲜橙",
"product_image": "https://drive.google.com/uc?id=1qgYHU1Bdqt4o8KZsY4lhyJl5Wsn_Bcxp&export=media",
"单位": "公斤",
“重量”:“1”,
“数量”:1,
“制造商”:299,
“价格”:199,
"total_price": 199,
“供应商_admin_commission”:0,
"item_status": "待定",
"created_at": "2021-06-23 07:08:06",
"updated_at": "2021-06-23 07:08:06"
}
]
},
{
“编号”:11,
"order_id": 11,
"vendor_id": 1,
"delivery_boy_id": 1,
"invoice_ref_no": "INV-16244320866",
“总计”:360,
"admin_commission": 0,
"invoice_total": 360,
“状态”:“已交付”,
"created_at": "2021-06-23 07:08:06",
"updated_at": "2021-06-23 13:17:42",
“vendor_data”:{
“编号”:1,
"vendor_image": "https://drive.google.com/uc?id=1Zwskric14eE6vfDVINALWEiczP7Y0SNo&export=media",
"vendor_name": "Shiv Shakti 乳业",
"employee_name": "沙希坎特古普塔",
“dob”:“1999-06-01”,
"admin_share": "5",
“手机”:“+91 1234567890”,
"电子邮件": "shiv@yahoo.com",
"city_id": 5,
"delivery_range": "5",
"is_best_seller": 1,
"is_trending": 1,
“纬度”:“23.0550°”,
“经度”:“72.5493°”,
“fcm_token”:空,
"vendor_address": "近梦缺",
“start_time”:空,
“end_time”:空,
“time_interval”:空,
"created_at": "2021-06-17 06:58:37",
"updated_at": "2021-06-23 10:31:47",
"vendor_status": "在线",
“状态”:“活跃”,
“mobile_verified”:“假”
},
“order_invoice_items”:[
{
“编号”:26,
"invoice_id": 11,
"vendor_id": 1,
"product_id": 1,
"product_name": "阿穆尔牛奶",
"product_image": "https://drive.google.com/uc?id=1O61-FmFD0pgqSKpgjRdi4X6wEMtaQF7l&export=media",
"单位": "公斤",
“重量”:“1”,
“数量”:2,
“制造商”:200,
“价格”:180,
"total_price": 360,
“供应商_admin_commission”:0,
"item_status": "待定",
"created_at": "2021-06-23 07:08:06",
"updated_at": "2021-06-23 07:08:06"
}
]
},
{
“编号”:12,
"order_id": 11,
"vendor_id": 7,
"delivery_boy_id": 1,
"invoice_ref_no": "INV-16244320869",
“总计”:480,
"admin_commission": 0,
"invoice_total": 480,
“状态”:“已交付”,
"created_at": "2021-06-23 07:08:06",
"updated_at": "2021-06-23 13:17:42",
“vendor_data”:{
“编号”:7,
“vendor_image”:空,
"vendor_name": "维卡斯夏尔马",
"employee_name": "维卡斯",
"dob": "1996-08-20",
"admin_share": "2",
“手机”:“+91 9772718131”,
“电子邮件”:“vks7860@gmail.com”,
"city_id": 9,
"delivery_range": "50",
"is_best_seller": 0,
"is_trending": 0,
“纬度”:“27.903875000000003”,
“经度”:“74.925035”,
“fcm_token”:空,
"vendor_address": "西卡",
“start_time”:空,
“end_time”:空,
“time_interval”:空,
"created_at": "2021-06-17 10:26:56",
"updated_at": "2021-06-24 12:56:23",
"vendor_status": "在线",
“状态”:“活跃”,
“mobile_verified”:“真”
},
“order_invoice_items”:[
{
“编号”:27,
"invoice_id": 12,
"vendor_id": 1,
"product_id": 1,
"product_name": "阿穆尔牛奶",
"product_image": "https://drive.google.com/uc?id=1O61-FmFD0pgqSKpgjRdi4X6wEMtaQF7l&export=media",
"单位": "公斤",
“重量”:“1”,
“数量”:2,
“制造商”:200,
“价格”:180,
"total_price": 360,
“供应商_admin_commission”:0,
"item_status": "待定",
"created_at": "2021-06-23 07:08:06",
"updated_at": "2021-06-23 07:08:06"
},
{
“编号”:28,
"invoice_id": 12,
"vendor_id": 7,
"product_id": 9,
"product_name": "巧克力蛋糕",
"product_image": "https://drive.google.com/uc?id=1yeuAQaiRH9656oUzsaR7-Bu8147RK3Q3&export=media",
"单位": "升",
“重量”:“1.25”,
“数量”:2,
“制造商”:75,
“价格”:60,
"total_price": 120,
“供应商_admin_commission”:0,
"item_status": "待定",
"created_at": "2021-06-23 07:08:06",
"updated_at": "2021-06-23 07:08:06"
}
]
}
],
“order_payment”:{
“编号”:25,
"order_id": 11,
"payment_mode": "货到付款",
"transaction_id": "paisa lai lidha che",
“评论”:“vshs”,
“数量”:701,
“文件”:空,
"created_at": "2021-06-23 11:21:59",
"updated_at": "2021-06-23 11:21:59"
},
“状态”:“已交付”
}
],
"message": "订单详情查询成功!!"
}
欢迎您,
您的问题不清楚,但据我了解,您正在尝试将“数据”字段放入列表中。仅调用以下 ;
List armut = yourjsonname["data"];
下次提问时请提供相关信息。
{ “成功”:真实, “数据”: [ { “编号”:11, "order_ref_no": "OA-1624432086", "customer_id": 1, "customer_address_id": 1, "order_date": "2021-06-23", "delivery_date": "2021-06-27", "delivery_time_from": "12:00:00", "delivery_time_to": "14:00:00", "sub_total": 679, "delivery_charges": 22, "order_total": 701, "order_status": "完成", “顾客”: { “编号”:1, “照片”:“https://drive.google.com/uc?id=17nPK4ChZG1Pv7hkYI0MN2ZYsjj646yI7&export=media”, "first_name": "维沙尔", "last_name": "夏尔马", "email": "vishal@gmail.com", "手机": "+91 1111111111", "dob": "2021-06-17", "mobile_verified": "真", “fcm_token”:空, “纬度”:空, “经度”:空, “状态”:“活跃”, "created_at": "2021-06-17 05:35:51", "updated_at": "2021-06-23 10:28:00" }, “customer_address”:{ “编号”:1, "customer_id": 1, "address_type": "办公室", "receiver_name": "megha", "receiver_contact_number": "9632589632", "state_id": 1, “区域”:“尼科尔”, “密码”:382350, "house_no": "c-122", "city_id": 2, "address_1": "奉爱圈", "address_2": "印度古吉拉特邦艾哈迈达巴德", “纬度”:“23.1218578”, “经度”:“72.545334”, "created_at": "2021-06-17 10:07:36", "updated_at": "2021-06-23 07:06:04", “deleted_at”:空 }, “order_invoice”:[ { “编号”:10, "order_id": 11, "vendor_id": 8, "delivery_boy_id": 1, "invoice_ref_no": "INV-16244320863", “总数”:199, "admin_commission": 0, "invoice_total": 199, “状态”:“已交付”, "created_at": "2021-06-23 07:08:06", "updated_at": "2021-06-23 13:17:42", “vendor_data”:{ “编号”:8, "vendor_image": "https://drive.google.com/uc?id=1sLdbAUjb9TbVUX6yxdZ6qbMi9EDUbjkf&export=media", "vendor_name": "蔬菜店", "employee_name": "斯里坎特", "dob": "1980-06-17", "admin_share": "2", “手机”:“+91 9292929292”, "email": "sri@gmail.com", "city_id": 1, "delivery_range": "2", "is_best_seller": 1, "is_trending": 1, “纬度”:“19.6641°”, “经度”:“78.5320°”, “fcm_token”:空, "vendor_address": "靠近海德街", “start_time”:空, “end_time”:空, “time_interval”:空, "created_at": "2021-06-17 12:29:48", "updated_at": "2021-06-17 12:29:48", "vendor_status": "在线", “状态”:“活跃”, “mobile_verified”:“假” }, “order_invoice_items”:[ { “编号”:25, "invoice_id": 10, "vendor_id": 8, "product_id": 6, "product_name": "鲜橙", "product_image": "https://drive.google.com/uc?id=1qgYHU1Bdqt4o8KZsY4lhyJl5Wsn_Bcxp&export=media", "单位": "公斤", “重量”:“1”, “数量”:1, “制造商”:299, “价格”:199, "total_price": 199, “供应商_admin_commission”:0, "item_status": "待定", "created_at": "2021-06-23 07:08:06", "updated_at": "2021-06-23 07:08:06" } ] }, { “编号”:11, "order_id": 11, "vendor_id": 1, "delivery_boy_id": 1, "invoice_ref_no": "INV-16244320866", “总计”:360, "admin_commission": 0, "invoice_total": 360, “状态”:“已交付”, "created_at": "2021-06-23 07:08:06", "updated_at": "2021-06-23 13:17:42", “vendor_data”:{ “编号”:1, "vendor_image": "https://drive.google.com/uc?id=1Zwskric14eE6vfDVINALWEiczP7Y0SNo&export=media", "vendor_name": "Shiv Shakti 乳业", "employee_name": "沙希坎特古普塔", “dob”:“1999-06-01”, "admin_share": "5", “手机”:“+91 1234567890”, "电子邮件": "shiv@yahoo.com", "city_id": 5, "delivery_range": "5", "is_best_seller": 1, "is_trending": 1, “纬度”:“23.0550°”, “经度”:“72.5493°”, “fcm_token”:空, "vendor_address": "近梦缺", “start_time”:空, “end_time”:空, “time_interval”:空, "created_at": "2021-06-17 06:58:37", "updated_at": "2021-06-23 10:31:47", "vendor_status": "在线", “状态”:“活跃”, “mobile_verified”:“假” }, “order_invoice_items”:[ { “编号”:26, "invoice_id": 11, "vendor_id": 1, "product_id": 1, "product_name": "阿穆尔牛奶", "product_image": "https://drive.google.com/uc?id=1O61-FmFD0pgqSKpgjRdi4X6wEMtaQF7l&export=media", "单位": "公斤", “重量”:“1”, “数量”:2, “制造商”:200, “价格”:180, "total_price": 360, “供应商_admin_commission”:0, "item_status": "待定", "created_at": "2021-06-23 07:08:06", "updated_at": "2021-06-23 07:08:06" } ] }, { “编号”:12, "order_id": 11, "vendor_id": 7, "delivery_boy_id": 1, "invoice_ref_no": "INV-16244320869", “总计”:480, "admin_commission": 0, "invoice_total": 480, “状态”:“已交付”, "created_at": "2021-06-23 07:08:06", "updated_at": "2021-06-23 13:17:42", “vendor_data”:{ “编号”:7, “vendor_image”:空, "vendor_name": "维卡斯夏尔马", "employee_name": "维卡斯", "dob": "1996-08-20", "admin_share": "2", “手机”:“+91 9772718131”, “电子邮件”:“vks7860@gmail.com”, "city_id": 9, "delivery_range": "50", "is_best_seller": 0, "is_trending": 0, “纬度”:“27.903875000000003”, “经度”:“74.925035”, “fcm_token”:空, "vendor_address": "西卡", “start_time”:空, “end_time”:空, “time_interval”:空, "created_at": "2021-06-17 10:26:56", "updated_at": "2021-06-24 12:56:23", "vendor_status": "在线", “状态”:“活跃”, “mobile_verified”:“真” }, “order_invoice_items”:[ { “编号”:27, "invoice_id": 12, "vendor_id": 1, "product_id": 1, "product_name": "阿穆尔牛奶", "product_image": "https://drive.google.com/uc?id=1O61-FmFD0pgqSKpgjRdi4X6wEMtaQF7l&export=media", "单位": "公斤", “重量”:“1”, “数量”:2, “制造商”:200, “价格”:180, "total_price": 360, “供应商_admin_commission”:0, "item_status": "待定", "created_at": "2021-06-23 07:08:06", "updated_at": "2021-06-23 07:08:06" }, { “编号”:28, "invoice_id": 12, "vendor_id": 7, "product_id": 9, "product_name": "巧克力蛋糕", "product_image": "https://drive.google.com/uc?id=1yeuAQaiRH9656oUzsaR7-Bu8147RK3Q3&export=media", "单位": "升", “重量”:“1.25”, “数量”:2, “制造商”:75, “价格”:60, "total_price": 120, “供应商_admin_commission”:0, "item_status": "待定", "created_at": "2021-06-23 07:08:06", "updated_at": "2021-06-23 07:08:06" } ] } ], “order_payment”:{ “编号”:25, "order_id": 11, "payment_mode": "货到付款", "transaction_id": "paisa lai lidha che", “评论”:“vshs”, “数量”:701, “文件”:空, "created_at": "2021-06-23 11:21:59", "updated_at": "2021-06-23 11:21:59" }, “状态”:“已交付” } ], "message": "订单详情查询成功!!" }
欢迎您, 您的问题不清楚,但据我了解,您正在尝试将“数据”字段放入列表中。仅调用以下 ;
List armut = yourjsonname["data"];
下次提问时请提供相关信息。