addIfNotNull method

bool addIfNotNull(
  1. E? value
)

Adds value to the end of this list only if it's not null.

The list must be growable.

Implementation

bool addIfNotNull(E? value) {
  if (value != null) {
    add(value);
    return true;
  } else {
    return false;
  }
}