isLeaf property
bool
get
isLeaf
Getter to check if the node is a Leaf. A Leaf-Node does have any children.
A Root-Node with no children, will also be a Leaf-Node.
Implementation
bool get isLeaf => childrenAsList.isEmpty;