gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 10:59:15 25 4
gpt4 key购买 nike

当我需要显示像 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 candisplay Tree layout, Directed and Layered graph. Useful for FamilyTree, 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com