абстрактный метод retainWhere
-
bool test(
- E element
Удаляет из этого списка все объекты, которые не удовлетворяют test.
Объект o удовлетворяет test, если test(o) имеет значение true.
final numbers = <String>['one', 'two', 'three', 'four']; numbers.retainWhere((item) => item.length == 3); print(numbers); // [one, two]
Список должен быть расширяемым.
Реализация
void retainWhere(bool test(E element));
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.19.6/dart-core/List/retainWhere.html