Minor widget_tester refactoring and docs (#3472)
This reorders some classes so that this file makes more sense, and adds a bunch of docs. It also makes the following changes: * Move allElements from Instrumentation to TestWidgets. (Instrumentation is going away.) * Remove findElements. * Rename byElement to byElementPredicate * Rename byPredicate to byWidgetPredicate * Implement _WidgetPredicateFinder so that byWidgetPredicate has good messages * Fix one use of byElementPredicate to use byWidgetPredicate.
This commit is contained in:
@@ -15,8 +15,7 @@ void main() {
|
||||
tester.pump(); // see https://github.com/flutter/flutter/issues/1865
|
||||
tester.pump(); // triggers a frame
|
||||
|
||||
Finder navigationMenu = find.byElement((Element element) {
|
||||
Widget widget = element.widget;
|
||||
Finder navigationMenu = find.byWidgetPredicate((Widget widget) {
|
||||
if (widget is Tooltip)
|
||||
return widget.message == 'Open navigation menu';
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user