byWidget method

Finder byWidget(
  1. Widget widget,
  2. {bool skipOffstage = true}

Finds widgets whose current widget is the instance given by the argument.

Sample code

// Suppose you have a button created like this:
Widget myButton = Button(
  child: Text('Update')

// You can find and tap on it like this:

If the skipOffstage argument is true (the default), then this skips nodes that are Offstage or that are from inactive Routes.


Finder byWidget(Widget widget, { bool skipOffstage = true }) => _WidgetFinder(widget, skipOffstage: skipOffstage);