I have a list of map that looks like:
List<dynamic> lists = [
{"name":"SpiderMan",
"genere":"superhero"
},
{"name":"Batman",
"genere":"superhero"
},
{"name":"Notebook",
"genere":"romance"
},
{"name":"Titanic",
"genere":"romance"
}
]
And what I want to do is that I want to organize the movies into one map that has same genere, the output that I want is like:
[{romance:[
{"name":"Notebook",
"genere":"romance"
},
{"name":"Titanic",
"genere":"romance"
}
]},superhero:[
{
"name":"Notebook",
"genere":"romance"
},
{"name":"Titanic",
"genere":"romance"
}
]]
2
Answers
Use This Model
You can get both together . To store data
to get data list
Using
groupBy
in importcode will be
”’
”’