activateFocused method

TreeNode<T>? activateFocused()

Toggle / activate the focused row: folders expand, leaves select. Returns the activated leaf node (for the host to open), or null.

Implementation

TreeNode<T>? activateFocused() {
  final id = focused;
  if (id == null) return null;
  final n = node(id);
  if (n == null) return null;
  if (n.isFolder) {
    toggle(id);
    return null;
  }
  select(id);
  return n;
}