I am trying to convert a map into a list. I'm trying to use the forEach() method.But i don't know where i'm going wrong.Can someone help? Also after converting them to lists,i want to access their index.How to do?
For eg: I have 2 maps
Map foodMap = {
value:50
title:'food',
}
Map travelMap={
value:30,
title:'travel'
}
List<String> sampleList = [];
I want to convert my two maps into list and add them into sampleList.