consecutivePairs method
Adjacent pairs of elements; empty if length < 2.
Implementation
List<(T, T)> consecutivePairs() {
if (length < 2) return <(T, T)>[];
return List<(T, T)>.generate(length - 1, (int i) => (this[i], this[i + 1]));
}
Adjacent pairs of elements; empty if length < 2.
List<(T, T)> consecutivePairs() {
if (length < 2) return <(T, T)>[];
return List<(T, T)>.generate(length - 1, (int i) => (this[i], this[i + 1]));
}