addIf method
void
addIf(
- dynamic condition,
- E item
Add item
to List<E> only if condition
is true.
Implementation
void addIf(condition, E item) {
if (condition is Condition) {
condition = condition();
}
if (condition is bool && condition) {
add(item);
}
}