of static method
Resolve a node's role from its depth and whether it hasChildren.
Implementation
static NavNodeRole of({required int depth, required bool hasChildren}) {
if (hasChildren) return depth == 0 ? NavNodeRole.module : NavNodeRole.group;
return depth == 0 ? NavNodeRole.direct : NavNodeRole.item;
}