isSatisfiedBy abstract method

bool isSatisfiedBy(
  1. T candidate
)

Checks if candidate satisfies this specification.

Returns true if candidate meets the business rule defined by this spec, false otherwise. This is the core method that subclasses implement to define their specific business logic.

Implement this method in your Spec subclasses to define the actual validation or business rule.

Example:

class MinimumAge extends Spec<Person> {
  final int minAge;
  MinimumAge(this.minAge);

  @override
  bool isSatisfiedBy(Person person) => person.age >= minAge;
}

Implementation

bool isSatisfiedBy(T candidate);