extensionGeneralLibMap<V> method
Iterable<V>
extensionGeneralLibMap<
V>({ - required bool isReverse,
- required V onData(
- T data,
- int index,
- int totalLength,
- bool isReverse,
),
})
Implementation
Iterable<V> extensionGeneralLibMap<V>({
required bool isReverse,
required V Function(T data, int index, int totalLength, bool isReverse)
onData,
}) sync* {
final int totalLength = length;
if (isReverse) {
for (int i = totalLength - 1; i >= 0; i--) {
yield onData(this[i], i, totalLength, isReverse);
}
} else {
for (int i = 0; i < totalLength; i++) {
yield onData(this[i], i, totalLength, isReverse);
}
}
return;
}