apply method

int apply(
  1. void lambda(
    1. T
    ), {
  2. bool ignoreExceptions = false,
})

Implementation

int apply(void Function(T) lambda, {bool ignoreExceptions = false}) {
  int appliedValues = 0;
  for (T element in this) {
    try {
      lambda(element);
      appliedValues++;
    } catch (error) {
      if (!ignoreExceptions) {
        rethrow;
      }
    }
  }

  return appliedValues;
}