evaluate method Null safety

Iterable<Element> evaluate()

Returns the current result. If precache was called and returned true, this will cheaply return the result that was computed then. Otherwise, it creates a new iterable to compute the answer.

Calling this clears the cache from precache.

Implementation

Iterable<Element> evaluate() {
  final Iterable<Element> result = _cachedResult ?? apply(allCandidates);
  _cachedResult = null;
  return result;
}