hasPrimaryControlAncestor function
True when a primary control already wraps element (nested InkWell, etc.).
Implementation
bool hasPrimaryControlAncestor(Element element) {
var found = false;
element.visitAncestorElements((ancestor) {
if (isPrimaryControlElement(ancestor)) {
found = true;
return false;
}
return true;
});
return found;
}