flutter_tree 1.1.0

Flutter Android iOS web

Flutter tree widget plugin, you can use this plugin to show a tree like layout, some thing a department tree.

Flutter Tree #

GitHub stars pub package test

example

Install #

dependencies:
  flutter_tree: ^1.0.0

Uasge #

TreeNode #

TreeNode(
  title: Text('This is a title!'),
  children: [
    TreeNode(
      title: Text('This is a title!'),
      children: <Widget>[
        TreeNode(title: Text('This is a title!')),
      ],
    ),
  ],
)

TreeView #

final List<Map<String, dynamic>> treeData = [
  {
    "title": "Title",
    "expaned": true,
    "children": [
      {
        "title": "Title",
        "expaned": true,
        "children": [],
      },
    ],
  }
];

TreeView(
  data: treeData,
  titleOnTap: () {
    print('title');
  },
  leadingOnTap: () {
    print('leading');
  },
  trailingOnTap: () {
    print('trailing');
  },
)

Config #

TreeNode #

propertytypedefaultdescriptionrequired
levelint0Item indent levelfalse
expanedbooleanfalseItem is expanedfalse
offsetLeftdouble24.0Item padding leftfalse
childrendoubleList<Widget>Children widget[]
titleWidgetText('Title')Title Widgetfalse
leadingWidgetIconButton()Leading widgetfalse
trailingWidgetIconButton()Trailing widgetfalse
titleOnTapFuctionnullTitle tap callbackfalse
leadingOnTapFuctionnullLeading tap callbackfalse
trailingOnTapFuctionnullTrailing tap Callbackfalse

TreeView #

propertytypedefaultdescriptionrequired
dataList<Map<String, dynamic>>nullTree datatrue
titleKeystringtitleTitle key in mapfalse
leadingKeystringleadingLeading key in mapfalse
expanedKeystringexpanedExpaned key in mapfalse
childrenKeystringchildrenChildren key in mapfalse
offsetLeftdouble24.0Item padding leftfalse
titleOnTapFuctionnullTitle tap callbackfalse
leadingOnTapFuctionnullLeading tap callbackfalse
trailingOnTapFuctionnullTrailing tap Callbackfalse

Contribute #

  1. Fork it (https://github.com/xrr2016/flutter_tree.git)
  2. Create your feature branch (git checkout -b feature/foo)
  3. Commit your changes (git commit -am 'Add some foo')
  4. Push to the branch (git push origin feature/foo)
  5. Create a new Pull Request

License #

MIT

13
likes
100
pub points
74%
popularity

Publisher

coldstone.fun

Flutter tree widget plugin, you can use this plugin to show a tree like layout, some thing a department tree.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_tree