setInnerHtml 方法

void setInnerHtml(
  1. String? html, {
  2. NodeValidator? validator,
  3. NodeTreeSanitizer? treeSanitizer,
})
override

将内容放置到 content 而不是作为子节点的一种覆盖。

另请参阅

实现

void setInnerHtml(String? html,
    {NodeValidator? validator, NodeTreeSanitizer? treeSanitizer}) {
  text = null;
  content!.nodes.clear();
  var fragment = createFragment(html,
      validator: validator, treeSanitizer: treeSanitizer);

  content!.append(fragment);
}