ConditionTester<T> typedef

ConditionTester<T> = bool Function(T value)

A typedef for a predicate function that tests a condition on a value of type T.

{@tool snippet}

typedef IsEven = ConditionTester<int>;

IsEven isEven = (int number) => number % 2 == 0;
final evenNumbers = [1, 2, 3, 4].where(isEven).toList();
print(evenNumbers); // [2, 4]

{@end-tool}

Implementation

typedef ConditionTester<T> = bool Function(T value);