byKey method

Finder byKey(
  1. Key key, {
  2. bool skipOffstage = true,
})

Finds widgets by searching for one with the given key.

Sample code

expect(find.byKey(backKey), findsOneWidget);

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

Implementation

Finder byKey(Key key, { bool skipOffstage = true }) => _KeyWidgetFinder(key, skipOffstage: skipOffstage);