метод any
bool any(Проверяет, удовлетворяет ли какой-либо элемент этого итерируемого объекта test.
Проверяет каждый элемент в порядке итерации и возвращает true, если какой-либо из них заставляет test вернуть true, в противном случае возвращает false.
Исходный код
bool any(bool test(E element)) {
int length = this.length;
for (int i = 0; i < length; i++) {
if (test(this[i])) return true;
if (length != this.length) {
throw new ConcurrentModificationError(this);
}
}
return false;
}
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-collection/ListMixin/any.html