buildFromPath static method
Recursively reads a file system path and returns a TreeNode<FileSystemEntity> hierarchy.
Implementation
static TreeNode<FileSystemEntity> buildFromPath(
FileSystem fs,
String path, {
bool expandRoot = true,
}) {
final entity = fs.isDirectorySync(path)
? fs.directory(path)
: fs.file(path);
final node = _buildNode(fs, entity);
if (expandRoot) {
node.isExpanded = true;
}
return node;
}