Finds widgets by searching for widgets with a particular type.
This does not do subclass tests, so for example
byType(StatefulWidget)
will never find anything since that's
an abstract class.
The type
argument must be a subclass of Widget.
Example:
expect(tester, hasWidget(find.byType(IconButton)));
If the skipOffstage
argument is true (the default), then this skips
nodes that are Offstage or that are from inactive Routes.
Source
Finder byType(Type type, { bool skipOffstage: true }) => new _WidgetTypeFinder(type, skipOffstage: skipOffstage);