from static method

CHECKBOXElement? from(
  1. Object? entry
)
override

Creates a DOMNode from dynamic parameter entry.

entry Can be a DOMNode, a String with HTML, a Text, a Function or an external element.

Implementation

static CHECKBOXElement? from(Object? entry) {
  if (entry == null) return null;
  if (_domHTML.isHtmlNode(entry)) {
    entry = _domHTML.toDOMNode(entry);
  }

  if (entry is CHECKBOXElement) return entry;

  if (entry is DOMElement) {
    _checkTag('input', entry);
    return CHECKBOXElement(
        attributes: entry._attributes,
        value: entry.value,
        commented: entry.isCommented);
  }

  return null;
}