addAllIf method

void addAllIf(
  1. dynamic condition,
  2. Iterable<E> items
)

Adds all items only if condition resolves to true.

Implementation

void addAllIf(dynamic condition, Iterable<E> items) {
  if (condition is Condition) condition = condition();
  if (condition is bool && condition) addAll(items);
}