dart:core
庫中Iterable.every
方法的用法介紹如下。
用法:
bool every(
bool test(
E element
)
)
檢查此迭代的每個元素是否滿足 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 Iterable.elementAt用法及代碼示例
- Dart Iterable.expand用法及代碼示例
- Dart Iterable.takeWhile用法及代碼示例
- Dart Iterable.skipWhile用法及代碼示例
- Dart Iterable.toSet用法及代碼示例
- Dart Iterable.singleWhere用法及代碼示例
- Dart Iterable.reduce用法及代碼示例
- Dart Iterable.where用法及代碼示例
- Dart Iterable.lastWhere用法及代碼示例
- Dart Iterable.contains用法及代碼示例
- Dart Iterable.join用法及代碼示例
- Dart Iterable.skip用法及代碼示例
- Dart Iterable.toList用法及代碼示例
- Dart Iterable.isNotEmpty用法及代碼示例
- Dart Iterable.isEmpty用法及代碼示例
- Dart Iterable.map用法及代碼示例
- Dart Iterable.take用法及代碼示例
- Dart Iterable.forEach用法及代碼示例
- Dart Iterable.firstWhere用法及代碼示例
- Dart Iterable.followedBy用法及代碼示例
- Dart Iterable.fold用法及代碼示例
- Dart Iterable.any用法及代碼示例
- Dart IterableMixin.isNotEmpty用法及代碼示例
- Dart IterableMixin.firstWhere用法及代碼示例
- Dart IterableMixin.lastWhere用法及代碼示例
注:本文由純淨天空篩選整理自dart.dev大神的英文原創作品 every method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。