elementOpen function

Element elementOpen(
  1. String tagname, [
  2. String? key,
  3. List<Object>? staticPropertyValuePairs,
  4. List<Object>? propertyValuePairs,
])

Declares an Element with zero or more attributes/properties that should be present at the current location in the document tree.

The tagname is name of the tag, e.g. 'div' or 'span'. This could also be the tag of a custom element.

A key identifies Element for reuse. See 'Keys and Arrays' in the IncrementalDOM documentation.

staticPropertyValuePairs is a list of pairs of property names and values. Depending on the type of the value, these will be set as either attributes or properties on the Element. These are only set on the Element once during creation. These will not be updated during subsequent passes. See 'Statics Array' in the IncrementalDOM documentation.

propertyValuePairs is a list of pairs of property names and values. Depending on the type of the value, these will be set as either attributes or properties on the Element.

Returns the corresponding DOM Element.

Implementation

Element elementOpen(
  String tagname, [
  String? key,
  List<Object>? staticPropertyValuePairs,
  List<Object>? propertyValuePairs,
]) {
  return _incDom.callMethod('elementOpen', <Object?>[
    tagname,
    key,
    JsArray.from(_mapArgs(staticPropertyValuePairs)),
    ..._mapArgs(propertyValuePairs),
  ]) as Element;
}