dart map element index code example
Example 1: flutter foreach with index
List _sample = ['a','b','c'];
_sample.asMap().forEach((index, value) => f);
Example 2: get index of element in map dart
myList.asMap().entries.map((entry) {
int idx = entry.key;
String val = entry.value;
return something;
}