addIf method
Adds an item to a list if a condition is met.
Parameters
condition
: The condition to checkelement
: The element to add
Implementation
void addIf(ConditionTester<T> condition, T element) {
for (var item in List<T>.from(this)) {
if (condition(item)) {
add(element);
}
}
return;
}