Skip to content

Instantly share code, notes, and snippets.

@skyjur
Last active January 22, 2019 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skyjur/8283e91c2c201ddb65ef073e76995f1d to your computer and use it in GitHub Desktop.
Save skyjur/8283e91c2c201ddb65ef073e76995f1d to your computer and use it in GitHub Desktop.
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment