forEachNonNull method
void
forEachNonNull(
- void action(
- T element
Applies the provided action
to each non-null element.
Example:
Iterable<int?>? numbers = [1, 2, 3, null];
numbers.forEachNonNull((num) => print(num)); // Output: 1, 2, 3
Implementation
void forEachNonNull(void Function(T element) action) {
validate().forEach(action);
}