insertBefore method

  1. @override
Node insertBefore(
  1. Node child,
  2. Node referenceNode
)
override

Implementation

@override
Node insertBefore(Node child, Node referenceNode) {
  if (child is Element) {
    documentElement ??= child;
  } else {
    throw UnsupportedError('Only Element can be inserted to Document');
  }
  return super.insertBefore(child, referenceNode);
}