Most languages provide something like this apples.map((apple, index) => {})
. What would be Dart's equivalent of identifying the index within a map or forEach?
Someone has offered apples.asMap().map((apple, index) => {})
however that returns an unmodifiable version of the map, which is not suitable when I'm trying to map a list to produce widgets .toList()
inside children:
of a Column
.