navigateDown method

void navigateDown()

Implementation

void navigateDown() {
  if (selectedNode == null) {
    if (roots.isNotEmpty) selectNode(roots.first);
    return;
  }

  final flattened = _getFlattenedNodes();
  final currentIndex = flattened.indexOf(selectedNode!);
  if (currentIndex >= 0 && currentIndex < flattened.length - 1) {
    selectNode(flattened[currentIndex + 1]);
  }
}