removeBetween method

void removeBetween(
  1. Node? previousChild,
  2. Node? nextChild,
  3. Node oldChild
)

Implementation

void removeBetween(Node? previousChild, Node? nextChild, Node oldChild) {
  assert(oldChild.parentNode == this);

  if (nextChild != null) {
    nextChild..previousSibling = previousChild;
  }
  if (previousChild != null) {
    previousChild.nextSibling = nextChild;
  }
  if (firstChild == oldChild) {
    firstChild = nextChild;
  }
  if (lastChild == oldChild) {
    lastChild = previousChild;
  }

  oldChild.previousSibling = null;
  oldChild.nextSibling = null;
  oldChild.parentOrShadowHostNode = null;
}