Predicate<T> typedef
Predicate<T> =
Bool Function(T value)
A function that takes a value of type T
and returns a boolean.
Used for testing or filtering values in collections or streams.
{@tool snippet}
final Predicate<int> isOdd = (value) => value.isOdd;
print(isOdd(3)); // true
{@end-tool}
Implementation
typedef Predicate<T> = Bool Function(T value);