treeNode method

Future<TreeNode<VEntity>> treeNode(
  1. BuildContext context, {
  2. bool addChildren = false,
})

Implementation

Future<TreeNode<VEntity>> treeNode(BuildContext context,
    {bool addChildren = false}) async {
  return TreeItem<VEntity>(
      data: this,
      children: this is VFolder && addChildren
          ? await Future.wait(await context.vfs
              .getChildren(this as VFolder)
              .asyncMap((e) =>
                  e.map((e) => e.treeNode(context, addChildren: addChildren)))
              .toList())
          : []);
}