flutter_tree_pro 0.0.15
flutter_tree_pro: ^0.0.15 copied to clipboard
Flutter tree select widget.You can use it to select tree nodes.This is also support RTL.
packages #
Flutter tree select widget.
Screenshot #
Usage #
To use this plugin, add flutter_tree_pro as a dependency in your pubspec.yaml file.
dependencies:
flutter_tree_pro: ^0.0.14
Use as a widget
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Flutter tree pro')),
body: Container(
child: FlutterTreePro(
listData: treeListData,
initialListData: initialTreeData,
config: Config(
parentId: 'parentId',
dataType: DataType.DataList,
label: 'value',
),
onChecked: (List<Map<String, dynamic>> checkedList) {},
),
),
);
}
Property #
| property | description |
|---|---|
| listData | The data source |
| treeData | The tree source when using DataMap |
| initialTreeData | Fallback root data for DataMap when treeData is empty |
| initialListData | The initial data source |
| parentId | The key name of parent id |
| dataType | The type of data source |
| label | The key name of the value |
| onChecked | The item checked callback function |
| isExpanded | Expanded all items by default |
| isRTL | Right to left enable |
Notes #
DataType.DataList: setlistDataandinitialListData.DataType.DataMap:treeDatahas higher priority; whentreeDatais empty,initialTreeDatais used as fallback root data.- Multi-select
onCheckedreturns checked leaf nodes after deduplication/filtering, not every checked parent node. Config.valueis reserved for compatibility and is not part of current select-state calculation.