# addIf method

void addIf(

1. ConditionTester<T> condition,
2. T element

)

Adds an item to a list if a condition is met.

## Parameters

- `condition`: The condition to check
- `element`: 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;
    }