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

A tree frame project.

应用截图

数据定义 #

import 'package:simple_tree/simple_tree.dart';

final List<DataBean> data = <DataBean>[
  //可定义可不定义样式
  DataBean( '餐饮', style: const TextStyle( fontSize: 34.0, fontWeight: FontWeight.bold, ),),
  DataBean('西餐', children: [...dataDetail]),
 
];

final List<DataBean> dataDetail = [
  DataBean('意大利菜', style: const TextStyle(fontFamily: 'NotoSansSC', fontSize: 20.0, color: Colors.blue)),
  DataBean('法式料理'),
  DataBean('美式快餐'),
  DataBean('西班牙菜'),
];


//定义 一对一关系
List<PageInfo> myAppPages = [
  PageInfo(name: '餐饮', widget: const P1()),
  PageInfo(name: '意大利菜', widget: const P2()),
  PageInfo(name: '法式料理', widget: Page3()),
  PageInfo(name: '美式快餐', widget: const TestIndexStack()),
];

使用方法 #

home.dart

void initState() {
    super.initState();
    //可定义可不定义样式
    // Config.style = const TextStyle(fontSize: 20.0, color: Colors.blue); 
    Config.init(myAppPages);
  }



  Widget build(BuildContext context) {
    return Scaffold(
      key: scaffoldStateKey,
      appBar: getAppBar(),
      body: TreeWidget(data: data),
    );
  }
0
likes
0
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

A tree frame project.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on simple_tree