focusInto method

void focusInto()

→ key: expand a collapsed folder, else step into the first child.

Implementation

void focusInto() {
  final id = focused;
  if (id == null) return;
  final n = node(id);
  if (n == null) return;
  if (n.isFolder && n.hasChildren && !_expanded.contains(id)) {
    _expanded.add(id);
    notifyListeners();
  } else if (n.hasChildren) {
    _focused = n.children.first.id;
    notifyListeners();
  }
}