I would like to get access to all indexes in my map. Since the number of variables in the list changes.
I tried something like this but it did not work
final fruitList = ['apple', 'orange', 'mango', 'variable', ''variable2'];
final fruitMap = myList.asMap(); // {0: 'apple', 1: 'orange', 2: 'mango'}
print(fruitMap[0-5])
I could imagine that you have to make a loop but I had no success in making a loop for this map. The loop should continue until every index in the map is worked through. So that you will only print[i] and output as if print[0-5] was there