List<Map<String, dynamic>> httpResponse =[];
需要将提取的列表修改为新列表。该列表是通过Http请求获取的,需要添加一个名为all_answer
的密钥才能修改请求的列表并创建一个新的列表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"
]
},
{},
{},
....,
....,
]```