addAllIf method
Adds Iterable<E> to List<E> only if condition is true.
Implementation
void addAllIf(dynamic condition, Iterable<E> items) {
bool mergedCondition = false;
if (condition is ConditionCallback) mergedCondition = condition();
if (mergedCondition || (condition is bool && condition)) addAll(items);
}