isRoot property

bool get isRoot

Getter to check if the node is a root. Root is always the first node in a Tree. A Root-Node never has a parent.

A Root-Node with no children, will also be a Leaf-Node.

Implementation

bool get isRoot => parent == null;