firstVisuallyActionableElement method
First matching element that is on the current route and visually actionable.
Used by screenshot highlights so we never annotate off-route / covered widgets while another screen is painted.
Implementation
Element? firstVisuallyActionableElement(
Finder finder, {
bool requireHitTestable = false,
}) {
final candidates = requireHitTestable
? finder.hitTestable().evaluate()
: finder.evaluate();
for (final element in candidates) {
if (isElementVisuallyActionable(element)) {
return element;
}
}
return null;
}