getFirstElementByName function Null safety

Elem getFirstElementByName(
  1. String name
)

Returns first element matching Figma name

Implementation

Elem getFirstElementByName(String name) {
  var elems = getElementsByName(name);
  return elems.length > 0 ? elems[0] : Elem();
}