isLastChild property

bool get isLastChild

Returns true if this node is the last child of its parent

Implementation

bool get isLastChild {
  final parent = this.parent;
  if (parent == null) return false;
  return parent.children.lastOrNull == this;
}