forEachWhile method

*<Null safety>*

void forEachWhile (bool action(T element))

Implementation

void forEachWhile(bool Function(T element) action) {
  for (var element in this) {
    if (!action(element)) break;
  }
}