Widget firstWidget(Finder finder)

The first matching widget according to a depth-first pre-order traversal of the widget tree.

Throws a StateError if finder is empty.

  • Use widget if you only expect to match one widget.

Source

Widget/*=T*/ firstWidget/*<T extends Widget>*/(Finder finder) {
  TestAsyncUtils.guardSync();
  return finder.evaluate().first.widget;
}