当我需要显示像 Screen Below 这样的带有 TreeView 和连接器的设计时,我正在制作一个屏幕。 如果有人可以建议我如何从概念上创建这样的设计,那将是一个很大的帮助。 我试过 Gridview和 tree_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,
),
);
}),
);
最佳答案
使用名为 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/