isNestedContentTextElement function
Caption / badge Text nested under a tappable card, button, or row.
Without this, status badges ("Bedraad") and other copy inside an InkWell card were dropped while only nested icons were kept.
Skips captions that only repeat the parent button/card title, and any text under a compact icon host (glyph / merged semantics noise).
Implementation
bool isNestedContentTextElement(Element element) {
if (!_isVisibleTextHost(element)) return false;
if (!hasPrimaryControlAncestor(element)) return false;
// Field internals — value lives on the textInput row, not a nested text.
if (_selfOrAncestor<EditableText>(element) != null) return false;
if (_selfOrAncestor<TextField>(element) != null) return false;
if (_selfOrAncestor<CupertinoTextField>(element) != null) return false;
// IconButton / compact InkWell+Icon already is the observe row.
if (_isUnderCompactIconControl(element)) return false;
if (_isRedundantCaptionOfNearestPrimary(element)) return false;
return true;
}