forEach method
Iterates over each value in the vector. Skips over default values, which can be done very efficiently on sparse vectors.
Implementation
void forEach(void Function(int index, T value) callback) {
for (var index = 0; index < count; index++) {
final value = getUnchecked(index);
if (value != dataType.defaultValue) {
callback(index, value);
}
}
}