getWidgetInstanceByName function Null safety

dynamic getWidgetInstanceByName(
  1. String name,
  2. {Map<String, dynamic> properties = const {}}
)

Returns new Flutter widget instance referenced by it's Figma name with optional Map of properties to initialize the widget with.

Implementation

dynamic getWidgetInstanceByName(String name, {Map<String, dynamic> properties = const {}}) {
  var elem = getFirstElementByName(name);
  return elem.widget.widget.createInstance(properties);
}