simple_tree 1.1.2 copy "simple_tree: ^1.1.2" to clipboard
simple_tree: ^1.1.2 copied to clipboard

A highly performant and reactive tree structure widget for Flutter, built with rxflare for efficient state management and rendering.

历史上最简单的生成树 #

生成树方法 #

方法一 #

一、 定义menu.json文件 #

[
  {
    "index": 1,
    "name": "首页",
    "icon": "home"
  },
  {
    "index": 2,
    "name": "系统配置",
    "children": [
      { "index": 21, "name": "基础设置", "page": "a1" }
    ]
  },
 ]

二、手动改写 route_mapper.dart #

static final Map<String, Widget Function()> routes = {
   "a1": () => const AdminDashboardPage(),
 };

方法二 #

自动生成路由表 #

 运行  dart gen_route.dart   自动生成 route_mapper.dart文件

      条件:
        json中 page字段 和view下文件 类名一致

      例如:p_1.dart

        class P1 extends StatelessWidget {
             const P1({super.key});
             @override
             Widget build(BuildContext context) {
               return Text("P1");
             }
           }
   
      json 文件 
         {
           "index": 1,
           "name": "首页",
           "page": "P1",  ----> 这里要一致
           "icon": "home"
         },
   
0
likes
160
points
188
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A highly performant and reactive tree structure widget for Flutter, built with rxflare for efficient state management and rendering.

Repository (GitHub)
View/report issues

Topics

#tree #treeview #reactive #performance #flutter-widgets

License

MIT (license)

Dependencies

flutter, rxflare

More

Packages that depend on simple_tree