nextElementSibling property

  1. @override
XmlElement? get nextElementSibling
inherited

Return the next element sibling of this node, or null.

Implementation

@override
XmlElement? get nextElementSibling {
  if (parent != null) {
    final siblings = parent!.children;
    for (var i = 0; i < siblings.length - 1; i++) {
      if (identical(siblings[i], this)) {
        for (var j = i + 1; j < siblings.length; j++) {
          final candidate = siblings[j];
          if (candidate is XmlElement) {
            return candidate;
          }
        }
        return null;
      }
    }
  }
  return null;
}