Skip to content

Commit

Permalink
PatrolFinder: forward more methods, ignore deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Nov 13, 2023
1 parent dc73453 commit ab73795
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions packages/patrol_finders/lib/src/custom_finders/patrol_finder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Finder createFinder(dynamic matching) {
///
/// This is decorator around [Finder] that extends it with Patrol features, but
/// also preserves Finder's behavior.
class PatrolFinder extends MatchFinder {
class PatrolFinder implements MatchFinder {
/// Creates a new [PatrolFinder] with the given [finder] and [tester].
///
/// Usually, you won't use this constructor directly. Instead, you'll use the
Expand Down Expand Up @@ -449,12 +449,12 @@ class PatrolFinder extends MatchFinder {
FinderResult<Element> evaluate() => finder.evaluate();

@override
bool tryEvaluate() => finder.tryEvaluate();
Iterable<Element> findInCandidates(Iterable<Element> candidates) {
return finder.findInCandidates(candidates);
}

@override
Iterable<Element> apply(Iterable<Element> candidates) {
return finder.apply(candidates);
}
bool tryEvaluate() => finder.tryEvaluate();

@override
PatrolFinder get first {
Expand Down Expand Up @@ -485,9 +485,6 @@ class PatrolFinder extends MatchFinder {
return (finder as MatchFinder).matches(candidate);
}

@override
bool precache() => finder.precache();

@override
FinderResult<Element> get found => finder.found;

Expand All @@ -499,13 +496,36 @@ class PatrolFinder extends MatchFinder {
@override
Iterable<Element> get allCandidates => finder.allCandidates;

@override
String get description => finder.description;

@override
String toString({bool describeSelf = false}) {
return finder.toString(describeSelf: describeSelf);
}

@override
bool get hasFound => finder.hasFound;

@override
void reset() => finder.reset();

@override
void runCached(VoidCallback run) => finder.runCached(run);

@override
bool get skipOffstage => finder.skipOffstage;

@override
Iterable<Element> apply(Iterable<Element> candidates) {
// ignore: deprecated_member_use
return finder.apply(candidates);
}

@override
// ignore: deprecated_member_use
String get description => finder.description;

@override
// ignore: deprecated_member_use
bool precache() => finder.precache();
}

/// Useful methods that make chained finders more readable.
Expand Down

0 comments on commit ab73795

Please sign in to comment.