extensionGeneralLibMap<V> method

Iterable<V> extensionGeneralLibMap<V>({
  1. required bool isReverse,
  2. required V onData(
    1. T data,
    2. int index,
    3. int totalLength,
    4. 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;
}