setComponentState function Null safety
Sets Figma2Flutter component state by Figma name
and stateName
Implementation
void setComponentState(String name, String stateName,
[int index = 0, bool asDefault = false]) {
var elems = getElementsByName(name, index + 1);
if (index < elems.length) {
elems[index].widget?.setState(() {
elems[index].widget.componentState = stateName;
if (asDefault) elems[index].widget.defaultState = stateName;
});
}
}