isPreviousNode method

bool isPreviousNode(
  1. DOMNode other
)

Returns true if other is the previous sibling of this node parent.

Implementation

bool isPreviousNode(DOMNode other) {
  if (!isInSameParent(other) || identical(this, other)) return false;
  var otherIdx = other.indexInParent;
  return otherIdx >= 0 && otherIdx + 1 == indexInParent;
}