myList.asMap().entries.map((entry) {
int idx = entry.key;
String val = entry.value;
return something;
}
userBoard.map((element) {
// get index
var index = userBoard.indexOf(element);
return Container(
);
}).toList()
import 'package:collection/collection.dart';
void main() {
final fruitList = ['apple', 'orange', 'mango'];
final withIndices = fruitList.mapIndexed((index, fruit) => "$index - $fruit");
print(withIndices);
}
list.asMap().entries.map((e) {
var index = e.key;
var value = e.value;
// ...
}
userBoard.map((element) {
// get index
var index = userBoard.indexOf(element);
return Container(
);
}).toList()
userBoard.map((element) {
// get index
var index = userBoard.indexOf(element);
return Container(
);
}).toList()