flutter - 如何在 Flutter 中创建 TreeView 布局?

标签 flutter flutter-layout

当我需要显示像 Screen Below 这样的带有 TreeView 和连接器的设计时,我正在制作一个屏幕。 如果有人可以建议我如何从概念上创建这样的设计,那将是一个很大的帮助。 我试过 Gridviewtree_view到目前为止。

GridView.count(
  // Create a grid with 2 columns. If you change the scrollDirection to
  // horizontal, this produces 2 rows.
  crossAxisCount: 2,
  // Generate 100 widgets that display their index in the List.
  children: List.generate(100, (index) {
    return Center(
      child: Text(
        'Item $index',
        style: Theme.of(context).textTheme.headline,
      ),
    );
  }),
);

enter image description here

最佳答案

使用名为 GraphView 的公共(public) flutter 包

Flutter GraphView is used to display data in graph structures. It can display Tree layout, Directed and Layered graph. Useful for Family Tree, Hierarchy View.

The library is designed to support different graph layouts and currently works excellent with small graphs.

关于flutter - 如何在 Flutter 中创建 TreeView 布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58941074/

相关文章:

flutter - 如何动态更改 flutter 中的填充或边距

macos - 错误 : Unable to 'pub upgrade' flutter tool. 五秒后重试...(还剩 9 次尝试)

flutter - 如何在底部导航上方制作 flutter 抽屉

flutter - 行中忽略的小部件对齐

dart - 如何在 GridView flutter 中获取 GridTile 位置?

dart - Flutter- TextField 的扩展面板

flutter - 在 Flutter 中使用 Provider 更新和动画化 AnimatedList

Flutter:showGeneralDialog 不与最初调用 showGeneralDialog 的位置共享上下文

flutter - 在垂直 PageView 中包裹不同高度的项目 - Flutter

flutter - 如何使 onTap 只响应实际文本而不是整个 ListTile 宽度