isFirstChild property

bool isFirstChild

returns true iff this node is the first child of the parent or of the parent is null

Implementation

bool get isFirstChild {
  if (parent == null) return true;

  return parent!.children.first == this;
}