byKey method Null safety

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

Finds widgets by searching for one with a particular 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 }) => _KeyFinder(key, skipOffstage: skipOffstage);