dart:collection
庫中IterableMixin.every
方法的用法介紹如下。
用法:
bool every(
bool test(
E element
)
)
override
檢查此迭代的每個元素是否滿足 test
。
按迭代順序檢查每個元素,如果其中任何一個元素使 test
返回 false
,則返回 false
,否則返回 true
。
例子:
final planetsByMass = <double, String>{0.06: 'Mercury', 0.81: 'Venus',
0.11: 'Mars'};
// Checks whether all keys are smaller than 1.
final every = planetsByMass.keys.every((key) => key < 1.0); // true
相關用法
- Dart IterableMixin.elementAt用法及代碼示例
- Dart IterableMixin.expand用法及代碼示例
- Dart IterableMixin.isNotEmpty用法及代碼示例
- Dart IterableMixin.firstWhere用法及代碼示例
- Dart IterableMixin.lastWhere用法及代碼示例
- Dart IterableMixin.take用法及代碼示例
- Dart IterableMixin.any用法及代碼示例
- Dart IterableMixin.skipWhile用法及代碼示例
- Dart IterableMixin.reduce用法及代碼示例
- Dart IterableMixin.forEach用法及代碼示例
- Dart IterableMixin.toList用法及代碼示例
- Dart IterableMixin.map用法及代碼示例
- Dart IterableMixin.join用法及代碼示例
- Dart IterableMixin.followedBy用法及代碼示例
- Dart IterableMixin.isEmpty用法及代碼示例
- Dart IterableMixin.singleWhere用法及代碼示例
- Dart IterableMixin.skip用法及代碼示例
- Dart IterableMixin.fold用法及代碼示例
- Dart IterableMixin.toSet用法及代碼示例
- Dart IterableMixin.where用法及代碼示例
- Dart IterableMixin.contains用法及代碼示例
- Dart IterableMixin.takeWhile用法及代碼示例
- Dart Iterable.takeWhile用法及代碼示例
- Dart Iterable.skipWhile用法及代碼示例
- Dart Iterable.toSet用法及代碼示例
注:本文由純淨天空篩選整理自dart.dev大神的英文原創作品 every method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。