Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main() {
- Map firstMap = { "id": 1, "value": [{"key": "A"}, {"key": "B"}]};
- List valueList = firstMap["value"];
- List<Map> newList = valueList.map((valueItem) => {
- "id": firstMap["id"],
- "value": [valueItem]
- }).toList();
- print(newList);
- }
Add Comment
Please, Sign In to add comment