lead<T> function

T? lead<T>(
  1. List<T> values,
  2. int index,
  3. int offset
)

Lead: value at index i + offset; null if out of range.

Implementation

T? lead<T>(List<T> values, int index, int offset) {
  final int j = index + offset;
  return j >= 0 && j < values.length ? values[j] : null;
}