setComponentProperties function Null safety

void setComponentProperties(
  1. String name,
  2. String props,
  3. [int index = 0]
)

Set properties to Figma2Flutter element referenced by it's name

Implementation

void setComponentProperties(String name, String props, [int index = 0]) {
  Map<String, dynamic> properties = jsonDecode(props);
  var elems = getElementsByName(name, index + 1);

  if (index < elems.length) {
    elems[index].widget?.setState(() {
      elems[index].widget?.properties = properties;
    });
  }
}