android - 修改地图
问题描述
需要List<Map<String, dynamic>> httpResponse =[];
将获取的 List 修改为新的 List。List 是通过 Http 请求获取的,需要添加一个键all_answer
来修改请求的 List 并创建一个新的 List formatedRequest
。
结构体:-
{
"category": "History",
"type": "multiple",
"difficulty": "hard",
"question": "With which Greek philosopher",
"correct_answer": "Socrates",
"incorrect_answers": [
"Aristotle",
"Plato",
"Pythagoras"
]
},
{},
{},
....,
....,
]```
need to convert it to
```List<Map<String, dynamic>> formatedRequest =[];```
STRUCTURE:-
```[
{
"category": "History",
"type": "multiple",
"difficulty": "hard",
"question": "With which Greek philosopher",
"correct_answer": "Socrates",
"incorrect_answers": [
"Aristotle",
"Plato",
"Pythagoras"
],
"all_answers":[
"Aristotle",
"Plato",
"Pythagoras",
"Socrates"
]
},
{},
{},
....,
....,
]```
解决方案
推荐阅读
- php - TCPDF 报告未显示所有行
- javascript - 为什么在操作中使用符号是不好的做法?
- python - Scrapy登录到网站不成功
- python - 从数组中绘制轮廓和颜色网格
- css - CSS:使用 2 个不同的类和不同的边距相交 2 个 div - 异常或预期行为?
- ajax - 通过ajax将前端裁剪的图像上传到wordpress
- ios - SwiftUI 画布预览为一个视图显示多个视图
- sql - go-pg:将数据推送到现有数组
- java - 将过期证书留在 Java 证书存储区有什么影响?
- mysql - 使用 MySql 版本 8.0.17 更新包含章节、段落和段落内容的表格