FinderBase<CandidateType> class abstract

Encapsulates the logic for searching a list of candidates and filtering the candidates to only those that meet the requirements defined by the finder.

Implementations will need to implement allCandidates to define the total possible search space and findInCandidates to define the requirements of the finder.

This library contains Finder and SemanticsFinder for searching Flutter's element and semantics trees respectively.

If the search can be represented as a predicate, then consider using MatchFinderMixin along with the Finder or SemanticsFinder base class.

If the search further filters the results from another finder, consider using ChainedFinderMixin along with the Finder or SemanticsFinder base class.

Implementers

Constructors

FinderBase()

Properties

allCandidates Iterable<CandidateType>
Returns all of the items that will be considered by this finder.
no setter
first FinderBase<CandidateType>
Returns a variant of this finder that only matches the first item found by this finder.
no setter
found FinderResult<CandidateType>
The results of the latest evaluate or tryEvaluate call.
no setter
hasFound bool
Whether or not this finder has any results in found.
no setter
hashCode int
The hash code for this object.
no setterinherited
last FinderBase<CandidateType>
Returns a variant of this finder that only matches the last item found by this finder.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

at(int index) FinderBase<CandidateType>
Returns a variant of this finder that only matches the item at the given index found by this finder.
describeMatch(Plurality plurality) String
Describes zero, one, or more candidates that match the requirements of a finder.
evaluate() FinderResult<CandidateType>
Searches a set of candidates for those that meet the requirements set by this finder and returns the result of that search.
findInCandidates(Iterable<CandidateType> candidates) Iterable<CandidateType>
Returns all the items in the given list that match this finder's requirements.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets all state of this FinderBase.
runCached(VoidCallback run) → void
Runs the given callback using cached results.
toString({bool describeSelf = false}) String
A string representation of this finder or its results.
override
tryEvaluate() bool
Searches a set of candidates for those that meet the requirements set by this finder and returns whether the search found any matching candidates.

Operators

operator ==(Object other) bool
The equality operator.
inherited