allWidgets property
All widgets currently in the widget tree (lazy pre-order traversal).
Can contain duplicates, since widgets can be used in multiple places in the widget tree.
Implementation
Iterable<Widget> get allWidgets {
TestAsyncUtils.guardSync();
return allElements
.map<Widget>((Element element) => element.widget);
}