8 lines
222 B
Dart
8 lines
222 B
Dart
extension ListExtension<T> on List<T> {
|
|
Iterable<R> mapIndexed<R>(R Function(int index, T element) convert) sync* {
|
|
for (var index = 0; index < length; index++) {
|
|
yield convert(index, this[index]);
|
|
}
|
|
}
|
|
}
|