addIfNotNull method

void addIfNotNull(
  1. T? value
)

Adds value to the list only if it is not null.

Implementation

void addIfNotNull(T? value) {
  if (value != null) add(value);
}