fileTree static method

Tree fileTree(
  1. Map<String, dynamic> structure, {
  2. String? root,
})

Creates a file tree with directory styling.

Implementation

static Tree fileTree(Map<String, dynamic> structure, {String? root}) {
  return fromMap(structure, root: root)
    ..enumerator(TreeEnumerator.normal)
    ..itemStyleFunc((children, index) {
      final node = children[index];
      if (node.childrenNodes.isNotEmpty) {
        return Style().bold().foreground(Colors.info);
      }
      return Style().foreground(Colors.white);
    });
}