-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Replace [FinderBase] with [Finder] in the documentation of Matchers #168279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
10f1d7b
6ba249d
a69e27a
889fa7f
a4720b5
06726f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -44,7 +44,7 @@ import 'widget_tester.dart' show WidgetTester; | |||
/// * [findsAtLeast], when you want the finder to find at least a specific number of candidates. | ||||
const Matcher findsNothing = _FindsCountMatcher(null, 0); | ||||
|
||||
/// Asserts that the [Finder] locates at least one widget in the widget tree. | ||||
/// Asserts that the [FinderBase] locates at least one widget in the widget tree. | ||||
/// | ||||
/// This is equivalent to the preferred [findsAny] method. | ||||
/// | ||||
|
@@ -78,7 +78,7 @@ const Matcher findsWidgets = _FindsCountMatcher(1, null); | |||
/// * [findsAtLeast], when you want the finder to find at least a specific number of candidates. | ||||
const Matcher findsAny = _FindsCountMatcher(1, null); | ||||
|
||||
/// Asserts that the [Finder] locates at exactly one widget in the widget tree. | ||||
/// Asserts that the [FinderBase] locates at exactly one widget in the widget tree. | ||||
/// | ||||
/// This is equivalent to the preferred [findsOne] method. | ||||
/// | ||||
|
@@ -112,7 +112,7 @@ const Matcher findsOneWidget = _FindsCountMatcher(1, 1); | |||
/// * [findsAtLeast], when you want the finder to find at least a specific number of candidates. | ||||
const Matcher findsOne = _FindsCountMatcher(1, 1); | ||||
|
||||
/// Asserts that the [Finder] locates the specified number of widgets in the widget tree. | ||||
/// Asserts that the [FinderBase] locates the specified number of widgets in the widget tree. | ||||
/// | ||||
/// This is equivalent to the preferred [findsExactly] method. | ||||
/// | ||||
|
@@ -146,7 +146,7 @@ Matcher findsNWidgets(int n) => _FindsCountMatcher(n, n); | |||
/// * [findsAtLeast], when you want the finder to find at least a specific number of candidates. | ||||
Matcher findsExactly(int n) => _FindsCountMatcher(n, n); | ||||
|
||||
/// Asserts that the [Finder] locates at least a number of widgets in the widget tree. | ||||
/// Asserts that the [FinderBase] locates at least a number of widgets in the widget tree. | ||||
/// | ||||
/// This is equivalent to the preferred [findsAtLeast] method. | ||||
/// | ||||
|
@@ -644,7 +644,7 @@ AsyncMatcher matchesReferenceImage(ui.Image image) { | |||
/// cases that [SemanticsController.find] sometimes runs into. | ||||
/// | ||||
/// To retrieve the semantics data of a widget, use [SemanticsController.find] | ||||
/// with a [Finder] that returns a single widget. Semantics must be enabled | ||||
/// with a [FinderBase] that returns a single widget. Semantics must be enabled | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is indeed a FinderBase, specifically
Would it help to specify the type here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this file, I don't see any mention of a FinderBase in doc comments that specify its generic type, so let it without its generic type. |
||||
/// in order to use this method. | ||||
/// | ||||
/// ## Sample code | ||||
|
@@ -840,7 +840,7 @@ Matcher matchesSemantics({ | |||
/// cases that [SemanticsController.find] sometimes runs into. | ||||
/// | ||||
/// To retrieve the semantics data of a widget, use [SemanticsController.find] | ||||
/// with a [Finder] that returns a single widget. Semantics must be enabled | ||||
/// with a [FinderBase] that returns a single widget. Semantics must be enabled | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this file, I don't see any mention of a FinderBase in doc comments that specify its generic type, so let it without its generic type. |
||||
/// in order to use this method. | ||||
/// | ||||
/// ## Sample code | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was correct as-is. findsWidgets deals with widgets and so does Finder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
findsWidgets is an instance of the _FindsCountMatcher class.
This is the signature of the matches() method of _FindsCountMatcher:
As you can see, it takes a FinderBase, not a Finder, as its first argument. So I think that FinderBase is the correct type that should be used in this doc comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok you're right, they do all operate on FinderBase even when they have "widgets" in the name. I even see this below for findsOneWidget:
Indeed findsOne and findsOneWidget are identical.