{"id":15522039,"url":"https://github.com/monkeywie/flutter_treeview","last_synced_at":"2025-04-23T04:52:36.049Z","repository":{"id":256880515,"uuid":"856706319","full_name":"monkeyWie/flutter_treeview","owner":"monkeyWie","description":"A customizable and feature-rich tree view widget for Flutter.","archived":false,"fork":false,"pushed_at":"2024-12-27T02:10:14.000Z","size":982,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T05:35:02.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monkeyWie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-13T03:47:36.000Z","updated_at":"2024-12-27T02:10:17.000Z","dependencies_parsed_at":"2024-09-13T15:57:57.675Z","dependency_job_id":"6c02029f-f036-4f39-a948-14cc2100df4c","html_url":"https://github.com/monkeyWie/flutter_treeview","commit_stats":null,"previous_names":["monkeywie/flutter_treeview"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fflutter_treeview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fflutter_treeview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fflutter_treeview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeyWie%2Fflutter_treeview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monkeyWie","download_url":"https://codeload.github.com/monkeyWie/flutter_treeview/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372946,"owners_count":21419722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T10:39:19.932Z","updated_at":"2025-04-23T04:52:36.041Z","avatar_url":"https://github.com/monkeyWie.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Checkable TreeView\n\n[![Pub Version](https://img.shields.io/pub/v/checkable_treeview?color=blue\u0026logo=dart)](https://pub.dev/packages/checkable_treeview)\n[![Pub Points](https://img.shields.io/pub/points/checkable_treeview?color=blue\u0026logo=dart)](https://pub.dev/packages/checkable_treeview)\n[![License](https://img.shields.io/github/license/monkeyWie/flutter_treeview)](https://github.com/monkeyWie/flutter_treeview/blob/main/LICENSE)\n\nA checkable and customizable tree view widget for Flutter.\n\n## Screenshot\n\n![](https://raw.githubusercontent.com/monkeyWie/flutter_treeview/main/example/screenshots/example.gif)\n\n## Features\n\n- Hierarchical data display\n- Node selection with multi-select support\n- Expandable/collapsible nodes\n- Filtering and sorting capabilities\n- Customizable node appearance\n- \"Select All\" functionality\n- Expand/Collapse all nodes option\n\n## Getting Started\n\nTo use the TreeView widget in your Flutter project, follow these steps:\n\n```\nflutter pub add checkable_treeview\n```\n\n## Usage\n\nHere's a basic example of how to use the TreeView widget:\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:checkable_treeview/checkable_treeview.dart';\n\nvoid main() {\n  runApp(MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: Scaffold(\n        appBar: AppBar(\n          title: Text('TreeView Example'),\n        ),\n        body: TreeView\u003cString\u003e(\n          nodes: [\n            TreeNode(\n              label: const Text('Root'),\n              value: 'root',\n              icon: Icon(Icons.folder),\n              children: [\n                TreeNode(label: const Text('Child 1'), value: 'child1'),\n                TreeNode(label: const Text('Child 2'), value: 'child2'),\n              ],\n            ),\n          ],\n          onSelectionChanged: (selectedValues) {\n            print('Selected values: $selectedValues');\n          },\n        ),\n      ),\n    );\n  }\n}\n```\n\n## Customization\n\nThe TreeView widget offers various customization options:\n\n- `showSelectAll`: Enable/disable the \"Select All\" checkbox\n- `selectAllWidget`: Custom widget for the \"Select All\" option\n- `showExpandCollapseButton`: Show/hide expand/collapse buttons\n- `initialExpandedLevels`: Set the initial number of expanded levels\n\nFor more advanced customization, refer to the API documentation.\n\n## Advanced Features\n\n### Filtering\n\nTo implement filtering, use the `filter` method of the `TreeViewState`:\n\n```dart\n\nfinal treeViewKey = GlobalKey\u003cTreeViewState\u003cString\u003e\u003e();\n\ntreeViewKey.currentState?.filter('search keyword');\n```\n\n### Sorting\n\nTo implement sorting, use the `sort` method of the `TreeViewState`:\n\n```dart\nfinal treeViewKey = GlobalKey\u003cTreeViewState\u003cString\u003e\u003e();\n\ntreeViewKey.currentState?.sort((a, b) =\u003e a.label.compareTo(b.label));\n```\n\n### Set Select All\n\nTo set the select all state, use the `setSelectAll` method of the `TreeViewState`:\n\n```dart\nfinal treeViewKey = GlobalKey\u003cTreeViewState\u003cString\u003e\u003e();\n\ntreeViewKey.currentState?.setSelectAll(true);\n```\n\n### Expand/Collapse All\n\nTo expand or collapse all nodes, use the `expandAll` and `collapseAll` methods of the `TreeViewState`:\n\n```dart\nfinal treeViewKey = GlobalKey\u003cTreeViewState\u003cString\u003e\u003e();\n\ntreeViewKey.currentState?.expandAll();\ntreeViewKey.currentState?.collapseAll();\n```\n\n### Get Selected Nodes\n\nTo get the selected nodes, use the `getSelectedNodes` method of the `TreeViewState`:\n\n```dart\nfinal treeViewKey = GlobalKey\u003cTreeViewState\u003cString\u003e\u003e();\n\nfinal selectedNodes = treeViewKey.currentState?.getSelectedNodes();\n```\n\n### Get Selected Values\n\nTo get the selected values, use the `getSelectedValues` method of the `TreeViewState`:\n\n```dart\nfinal treeViewKey = GlobalKey\u003cTreeViewState\u003cString\u003e\u003e();\n\nfinal selectedValues = treeViewKey.currentState?.getSelectedValues();\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkeywie%2Fflutter_treeview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkeywie%2Fflutter_treeview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkeywie%2Fflutter_treeview/lists"}