replaceWhere method

bool replaceWhere(
  1. ReplaceValidator<T> validator,
  2. ReplaceValue<T> newValue
)

Implementation

bool replaceWhere(ReplaceValidator<T> validator, ReplaceValue<T> newValue) {
  bool foundOne = false;
  for (int i = 0; i < length; i++) {
    final item = elementAt(i);
    if (validator(item)) {
      foundOne = true;
      this[i] = newValue(item);
    }
  }
  return foundOne;
}