setComponentImageUrl function Null safety

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

Sets network image url to be displayed in the element referenced by it's Figma name Only works on Figma nodes that contain Image fill

Implementation

void setComponentImageUrl(String name, String url, [int index = 0]) {
  var elems = getElementsByName(name, index + 1);
  if (index < elems.length) {
    elems[index].widget?.setState(() {
        elems[index].widget?.image = Image.network(url);
    });
  }
}