level property

int get level

Getter to get the level i.e. how many iterations it will take to get to the root. ** Note: starting index is 0.

Implementation

int get level => parent == null ? 0 : parent!.level + 1;