Spec<T>.predicate constructor

const Spec<T>.predicate(
  1. bool predicate(
    1. T candidate
    )
)

Creates a spec from predicate.

The predicate is called with each candidate passed to isSatisfiedBy or call. The predicate is evaluated each time the spec is evaluated; its result is not cached.

Implementation

const factory Spec.predicate(bool Function(T candidate) predicate) =
    _Predicate<T>;