getComponentState function Null safety
Returns current sate name of the element referenced by Figma name
Implementation
String getComponentState(String name, [int index = 1]) {
var elems = getElementsByName(name, index);
if (index < elems.length) {
return elems[index].widget?.componentState;
}
return '';
}