{"id":26917662,"url":"https://github.com/talebrafiepour/nested_choice_list","last_synced_at":"2025-10-12T21:45:18.484Z","repository":{"id":270106274,"uuid":"909350195","full_name":"TalebRafiepour/nested_choice_list","owner":"TalebRafiepour","description":"A flutter package for handling nested list item selection without limitation for the depth of the nested list.","archived":false,"fork":false,"pushed_at":"2025-02-22T12:43:22.000Z","size":471,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T13:39:39.752Z","etag":null,"topics":["linked-list","list","nested-list","nested-routes"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/nested_choice_list","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TalebRafiepour.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-12-28T12:46:20.000Z","updated_at":"2025-02-22T12:43:25.000Z","dependencies_parsed_at":"2025-01-19T13:19:25.413Z","dependency_job_id":"972784b2-f760-4960-a063-895a22cd8644","html_url":"https://github.com/TalebRafiepour/nested_choice_list","commit_stats":null,"previous_names":["talebrafiepour/nested_choice_list"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalebRafiepour%2Fnested_choice_list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalebRafiepour%2Fnested_choice_list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalebRafiepour%2Fnested_choice_list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TalebRafiepour%2Fnested_choice_list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TalebRafiepour","download_url":"https://codeload.github.com/TalebRafiepour/nested_choice_list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709906,"owners_count":20821298,"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":["linked-list","list","nested-list","nested-routes"],"created_at":"2025-04-01T20:50:14.182Z","updated_at":"2025-10-12T21:45:18.479Z","avatar_url":"https://github.com/TalebRafiepour.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestedChoiceList\n[![Pub Version](https://img.shields.io/pub/v/nested_choice_list.svg?label=pub\u0026color=blue)](https://pub.dev/packages/nested_choice_list/versions)\n[![GitHub Stars](https://img.shields.io/github/stars/TalebRafiepour/nested_choice_list?color=yellow\u0026label=Stars)](https://github.com/TalebRafiepour/nested_choice_list/stargazers)\n[![GitHub opened issues](https://img.shields.io/github/issues/TalebRafiepour/nested_choice_list?color=red)](https://github.com/TalebRafiepour/nested_choice_list/issues)\n[![GitHub closed issues](https://img.shields.io/github/issues-closed/TalebRafiepour/nested_choice_list)](https://github.com/TalebRafiepour/nested_choice_list/issues?q=is%3Aissue+is%3Aclosed)\n![GitHub License](https://img.shields.io/github/license/TalebRafiepour/nested_choice_list)\n\nA powerful Flutter package designed to simplify the selection of items from deeply nested lists. With its robust features, you can create intuitive and flexible user interfaces that enhance the user experience without the constraints of traditional list handling.\n\n![nested-choice-list-demo](https://raw.githubusercontent.com/TalebRafiepour/showcase/main/nested_choice_list/sample-1-expandable-multiselect.gif)\n\n## Features\n\n* Create a list widget with a nesting depth ranging from 0 to infinite.\n* Support single selection and multiple selection modes.\n* Display the navigation path of selections through the nested list.\n* Enable search filtering across every page of the nested list.\n* Show the selected items at the top of the page.\n* Allow selecting all items in multi-selection mode.\n* Provide a callback for single selection mode: `onTapItem`.\n* Offer a callback for multi-selection mode: `onSelectionChange`.\n* Include a callback function for handling page changes with `onNavigationChange`.\n* Include customizable styles via `NestedListStyle`.\n* Supports both expandable and navigation modes for displaying items, which can be set using `NestedChoiceListType`.\n\n## Showcase\n### Single selection mode\n| showNavigationPath=true | enableSearch=true |\n|-------------------------|-------------------|\n| ![single-select-showNavigationPath](https://raw.githubusercontent.com/TalebRafiepour/showcase/main/nested_choice_list/single-select-with-navigation-path.gif) | ![single-select-enableSearch](https://raw.githubusercontent.com/TalebRafiepour/showcase/main/nested_choice_list/single-select-with-search.gif) |\n\n------------------------------------------------\n\n### Multiple selection mode\n|enableMultiSelect=true| showSelectedItem=true |\n|----------------------|-----------------------|\n| ![multi-select-with-select-all](https://raw.githubusercontent.com/TalebRafiepour/showcase/main/nested_choice_list/multi-selection-with-select-all.gif) | ![multi-select-with-show-selected-items](https://raw.githubusercontent.com/TalebRafiepour/showcase/main/nested_choice_list/multi-select-show-selected-item.gif) |\n\n|expandable mode|\n|---------------|\n| ![expandable-mode](https://raw.githubusercontent.com/TalebRafiepour/showcase/main/nested_choice_list/expandable-mode.gif) |\n\n\n## Installation\n\nTo use NestedChoiceList, you need to add it to your pubspec.yaml file:\n\n```yaml\ndependencies:\n  nested_choice_list: latest_version\n```\n\nThen, run `flutter pub get` to install the package.\n\n## Usage\nTo use NestedChoiceList in your Flutter app, first import the package:\n\n```dart\nimport 'package:nested_choice_list/nested_choice_list.dart';\n```\n\n### Initialize your items using NestedChoiceEntity class\n\n```dart\nfinal items = const [\n    NestedChoiceEntity(\n      value: 'value1',\n      label: 'label1 level1',\n      children: [\n        NestedChoiceEntity(value: 'value2', label: 'label1 level 2'),\n        NestedChoiceEntity(value: 'value3', label: 'label1 level 2'),\n        NestedChoiceEntity(\n          value: 'value4',\n          label: 'label1.2 level 2',\n          children: [\n            NestedChoiceEntity(value: 'value2', label: 'label1.2 level 3'),\n            NestedChoiceEntity(value: 'value3', label: 'label1.2 level 3'),\n            NestedChoiceEntity(\n              value: 'value4',\n              label: 'label1.3 level 3',\n              children: [\n                NestedChoiceEntity(value: 'value2', label: 'label1.3 level 4'),\n                NestedChoiceEntity(value: 'value3', label: 'label1.3 level 4'),\n                NestedChoiceEntity(value: 'value4', label: 'label1.3 level 4'),\n              ],\n            ),\n          ],\n        ),\n      ],\n    ),\n    NestedChoiceEntity(\n      value: 'value2',\n      label: 'label2 level1',\n      children: [\n        NestedChoiceEntity(value: 'value2', label: 'label2 level 2'),\n        NestedChoiceEntity(value: 'value3', label: 'label2 level 2'),\n        NestedChoiceEntity(\n          value: 'value4',\n          label: 'label2.1 level 2',\n          children: [\n            NestedChoiceEntity(value: 'value2', label: 'label2.1 level 3'),\n            NestedChoiceEntity(value: 'value3', label: 'label2.1 level 3'),\n            NestedChoiceEntity(value: 'value4', label: 'label2.1 level 3'),\n          ],\n        ),\n      ],\n    ),\n    NestedChoiceEntity(\n      value: 'value3',\n      label: 'label3 level1',\n      children: [\n        NestedChoiceEntity(value: 'value2', label: 'label3 level 2'),\n        NestedChoiceEntity(value: 'value3', label: 'label3 level 2'),\n        NestedChoiceEntity(value: 'value4', label: 'label3 level 2'),\n      ],\n    ),\n    NestedChoiceEntity(value: 'value4', label: 'label4 level1'),\n  ];\n```\n\n### Or Initialize your items using Json map\n\n```dart\nfinal jsonMap = const [\n    {\n      'value': 'value1',\n      'label': 'label1 level1',\n      'isDisabled': false,\n      'children': [\n        {\n          'value': 'value2',\n          'label': 'label2 level 2',\n        },\n        {\n          'value': 'value3',\n          'label': 'label3 level 2',\n        },\n        {\n          'value': 'value4',\n          'label': 'label4 level 2',\n          'children': [\n            {\n              'value': 'value2',\n              'label': 'label2 level 3',\n            },\n            {\n              'value': 'value3',\n              'label': 'label3 level 3',\n            },\n            {\n              'value': 'value4',\n              'label': 'label4 level 3',\n              'children': [\n                {\n                  'value': 'value2',\n                  'label': 'label2 level 4',\n                },\n                {\n                  'value': 'value3',\n                  'label': 'label3 level 4',\n                },\n                {\n                  'value': 'value4',\n                  'label': 'label4 level 4',\n                }\n              ]\n            }\n          ]\n        }\n      ]\n    },\n    {\n      'value': 'value2',\n      'label': 'label2 level1',\n      'children': [\n        {\n          'value': 'value2',\n          'label': 'label2 level 2',\n        },\n        {\n          'value': 'value3',\n          'label': 'label3 level 2',\n        },\n        {\n          'value': 'value4',\n          'label': 'label4 level 2',\n          'children': [\n            {\n              'value': 'value2',\n              'label': 'label2 level 3',\n            },\n            {\n              'value': 'value3',\n              'label': 'label3 level 3',\n            },\n            {\n              'value': 'value4',\n              'label': 'label4 level 3',\n            }\n          ]\n        }\n      ]\n    },\n    {\n      'value': 'value3',\n      'label': 'label3 level1',\n      'children': [\n        {\n          'value': 'value2',\n          'label': 'label2 level 2',\n        },\n        {\n          'value': 'value3',\n          'label': 'label3 level 2',\n        },\n        {\n          'value': 'value4',\n          'label': 'label4 level 2',\n        }\n      ]\n    },\n    {\n      'value': 'value4',\n      'label': 'label4 level1',\n    }\n  ];\n\nfinal items = jsonMap.map((e) =\u003e NestedChoiceEntity.fromJson(e)).toList();\n```\n\n### Then pass your items to the widget and use it\n\n```dart\nNestedChoiceList(\n        /// A list of items to be displayed in the nested choice list.\n        items: items,\n        /// A flag to determine whether to display the selected items.\n        showSelectedItems: showSelectedItems,\n        /// Enables or disables the \"Select All\" option in the list.\n        enableSelectAll: enableSelectAll,\n        /// A flag to determine whether to show the navigation path.\n        showNavigationPath: showNavigationPath,\n        /// Enables or disables multi-select functionality.\n        enableMultiSelect: enableMultiSelect,\n        /// Enables or disables the search functionality in the list.\n        enableSearch: enableSearch,\n        /// Applies a constant style to the nested list.\n        style: const NestedListStyle(),\n        // this callback triggers when we are in\n        // single select mode (enableMultiSelect = false)\n        onTapItem: (item) {\n          debugPrint('onTapItem -\u003e $item');\n          Navigator.of(context).pop(item);\n        },\n        // this callback triggers when we are in\n        // multi select mode (enableMultiSelect = true)\n        onSelectionChange: (items) {\n          debugPrint('onSelectionChange -\u003e $items');\n          selectedItems = items;\n        },\n        /// Callback function triggered when the navigation changes.\n        /// Useful for handling UI updates based on the current page index.\n        onNavigationChange: (pageIndex) {\n          debugPrint('onNavigationChange -\u003e pageIndex: $pageIndex');\n        },\n      )\n```\n\n## Support the Package\n\nIf you find `NestedChoiceList` useful, please consider supporting it by:\n\n* Liking the package on [pub.dev](https://pub.dev/packages/nested_choice_list).\n* Starring the repository on [GitHub](https://github.com/TalebRafiepour/nested_choice_list).\n* Reporting any issues or bugs you encounter [here](https://github.com/TalebRafiepour/nested_choice_list/issues).\n\nYour support helps improve the package and ensures its continued development.\n\n## Donate\n\n**If you wants to support me: \u003ca href=\"https://github.com/TalebRafiepour/TalebRafiepour/blob/main/DONATE.md\" alt=\"Donate button\"\u003e\u003cimg src=\"https://img.shields.io/badge/-Donate-red?logo=undertale\" /\u003e\u003c/a\u003e**\n\n## License\n\nNestedChoiceList is released under the `BSD-3-Clause` License.\n\n## Contact Me 📨\n\nFeel free to reach out to me through the following platforms:\n\n\u003ca href=\"https://github.com/TalebRafiepour\"\u003e\u003cimg src= \"https://img.icons8.com/ios-glyphs/344/github.png\" width = \"40px\"/\u003e\u003c/a\u003e \u003ca href=\"https://www.linkedin.com/in/taleb-rafiepour/\"\u003e\u003cimg src= \"https://img.icons8.com/color/344/linkedin.png\" width = \"40px\"/\u003e\u003c/a\u003e \u003ca href=\"mailto:taleb.r75@gmail.com\"\u003e\u003cimg src= \"https://img.icons8.com/color/344/gmail-new.png\" width = \"40px\"/\u003e\u003c/a\u003e\n\nI look forward to connecting with you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalebrafiepour%2Fnested_choice_list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalebrafiepour%2Fnested_choice_list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalebrafiepour%2Fnested_choice_list/lists"}