anyTrue property
bool
get
anyTrue
Checks if any element in the iterable is true
.
This getter iterates through each element in the iterable. If it
encounters an element that is true
, it returns true
. If no such
element is found after iterating through all elements, it returns
false
.
Returns:
true
if at least one element in the iterable istrue
.false
if no elements in the iterable aretrue
or the iterable is empty.
Implementation
bool get anyTrue => where((bool e) => e).isNotEmpty;