setComponentItems function Null safety
Sets ListView items on annotated ListView Figma element referenced by it's name
ListView items (itemsString
) are represented as array of JSON objects either as List
Implementation
void setComponentItems(String name, dynamic itemsString, [int index = 0]) {
List<Map<String, dynamic>> items = parseItems(itemsString);
var elems = getElementsByName(name, index + 1);
if (index < elems.length) {
elems[index].widget?.setState(() {
elems[index]
.widget
?.items
?.replaceRange(0, elems[index].widget.items.length, items);
});
}
}