Add a test for icon opacity crash

Fixes #2361
This commit is contained in:
Adam Barth
2016-03-03 10:33:57 -08:00
parent 8af3dde3af
commit 00a00deffc
3 changed files with 35 additions and 1 deletions

View File

@@ -75,6 +75,15 @@ class Instrumentation {
});
}
/// Returns the first [Widget] of the given [runtimeType], if any. Returns
/// null if there is no matching widget.
Widget findWidgetOfType(Type type) {
Element element = findElement((Element element) {
return element.widget.runtimeType == type;
});
return element?.widget;
}
/// Returns the [State] object of the first element whose state has
/// the given [runtimeType], if any. Returns null if there is no
/// matching element.