descendant method Null safety
Finds widgets that are descendants of the of
parameter and that match
the matching
parameter.
Sample code
expect(find.descendant(
of: find.widgetWithText(Row, 'label_1'), matching: find.text('value_1')
), findsOneWidget);
If the matchRoot
argument is true then the widget(s) specified by of
will be matched along with the descendants.
If the skipOffstage
argument is true (the default), then nodes that are
Offstage or that are from inactive Routes are skipped.
Implementation
Finder descendant({
required Finder of,
required Finder matching,
bool matchRoot = false,
bool skipOffstage = true,
}) {
return _DescendantFinder(of, matching, matchRoot: matchRoot, skipOffstage: skipOffstage);
}