{"id":21196335,"url":"https://github.com/davigmacode/flutter_choice","last_synced_at":"2026-03-05T14:03:42.324Z","repository":{"id":189169071,"uuid":"680163616","full_name":"davigmacode/flutter_choice","owner":"davigmacode","description":"The successor to smart_select and chips_choice with cleaner, more flexible, and composable API for creating inline or prompted choice widgets with single or multiple selection.","archived":false,"fork":false,"pushed_at":"2024-06-03T04:20:02.000Z","size":7832,"stargazers_count":26,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-30T07:48:35.241Z","etag":null,"topics":["bottom-sheet","checkbox","chips","choice","choices","dart","dialog","dropdown","flutter","flutter-package","inline-choice","multiple-choice","prompted-choice","radio","select","selection","single-choice","switch"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/choice","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/davigmacode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["davigmacode"],"patreon":null,"open_collective":null,"ko_fi":"davigmacode","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.buymeacoffee.com/davigmacode"]}},"created_at":"2023-08-18T13:48:48.000Z","updated_at":"2025-04-05T18:22:23.000Z","dependencies_parsed_at":"2023-08-18T16:11:25.919Z","dependency_job_id":"ed01072b-912e-41ed-b7fe-7732beda30f2","html_url":"https://github.com/davigmacode/flutter_choice","commit_stats":null,"previous_names":["davigmacode/flutter_choice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davigmacode/flutter_choice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_choice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_choice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_choice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_choice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davigmacode","download_url":"https://codeload.github.com/davigmacode/flutter_choice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_choice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30130031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bottom-sheet","checkbox","chips","choice","choices","dart","dialog","dropdown","flutter","flutter-package","inline-choice","multiple-choice","prompted-choice","radio","select","selection","single-choice","switch"],"created_at":"2024-11-20T19:35:36.876Z","updated_at":"2026-03-05T14:03:42.266Z","avatar_url":"https://github.com/davigmacode.png","language":"Dart","readme":"[![Pub Version](https://img.shields.io/pub/v/choice)](https://pub.dev/packages/choice) ![GitHub](https://img.shields.io/github/license/davigmacode/flutter_choice) [![GitHub](https://badgen.net/badge/icon/buymeacoffee?icon=buymeacoffee\u0026color=yellow\u0026label)](https://www.buymeacoffee.com/davigmacode) [![GitHub](https://badgen.net/badge/icon/ko-fi?icon=kofi\u0026color=red\u0026label)](https://ko-fi.com/davigmacode)\n\nThe successor to `smart_select` and `chips_choice` with cleaner, more flexible, and composable API for creating inline or prompted choice widgets with single or multiple selection.\n\n## Features\n\n* Cleaner, flexible, and composable API\n* Inline or prompted choice widget\n* Single or multiple choice widget\n* Searchable choice items with highlighted result\n* Specifies whether the choice selection needs to be confirmed\n* Use any type of choice data and load it easily, either synchronously or asynchronously\n* Build your own choice item that fits your needs\n* Groupable choice items that can be sorted\n* Supports leading and trailing choice items, as well as divider choice items\n* Use a predefined wrapped, scrollable, virtualized choice list, or build one that fits your needs\n* Use a predefined popup dialog, bottom sheet, new page prompt, or build one that fits your needs\n* Use a predefined modal header, footer, and separator, or build one that fits your needs\n* Use a predefined group list, group item, and group header, or build one that fits your needs\n* Use a predefined anchor widget or build one that fits your needs\n* Use a predefined widget on loading, on error, and placeholder when empty, or build one that fits your needs\n\n## Usage\n\nFor a complete usage, please see the [example](https://davigmacode.github.io/flutter_choice).\n\nTo read more about classes and other references used by `choice`, see the [API Reference](https://pub.dev/documentation/choice/latest/).\n\n### Single Choice\n[![Preview](https://github.com/davigmacode/flutter_choice/raw/main/media/choice-single.gif)](https://davigmacode.github.io/flutter_choice)\n\nThere are a few constructors to create a single selection choice widget:\n* [`Choice.inline`](https://pub.dev/documentation/choice/latest/choice/Choice/Choice.inline.html)\n* [`Choice.prompt`](https://pub.dev/documentation/choice/latest/choice/Choice/Choice.prompt.html)\n* [`InlineChoice`](https://pub.dev/documentation/choice/latest/choice_inline/InlineChoice/InlineChoice.html)\n* [`InlineChoice.single`](https://pub.dev/documentation/choice/latest/choice_inline/InlineChoice/InlineChoice.single.html)\n* [`PromptedChoice`](https://pub.dev/documentation/choice/latest/choice_prompt/PromptedChoice/PromptedChoice.html)\n* [`PromptedChoice.single`](https://pub.dev/documentation/choice/latest/choice_prompt/PromptedChoice/PromptedChoice.single.html)\n\nBy default, the choice controller maintains the selection state within a `List`. Any constructors other than those dedicated to single choice will have a `List\u003cT\u003e` for their `value` and `onChanged` prop. If we want to use a single value of `T`, we can use `ChoiceSingle.value` adapter to fill the `value` prop and `ChoiceSingle.onChanged` adapter to fill the `onChanged` prop.\n\nHere is an example of how to use the `ChoiceSingle.value` and `ChoiceSingle.onChanged` adapters\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:choice/choice.dart';\n\nclass InlineScrollableX extends StatefulWidget {\n  const InlineScrollableX({super.key});\n\n  @override\n  State\u003cInlineScrollableX\u003e createState() =\u003e _InlineScrollableXState();\n}\n\nclass _InlineScrollableXState extends State\u003cInlineScrollableX\u003e {\n  List\u003cString\u003e choices = [\n    'News',\n    'Entertainment',\n    'Politics',\n    'Automotive',\n    'Sports',\n    'Education',\n    'Fashion',\n    'Travel',\n    'Food',\n    'Tech',\n    'Science',\n    'Arts'\n  ];\n\n  String? selectedValue;\n\n  void setSelectedValue(String? value) {\n    setState(() =\u003e selectedValue = value);\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Column(\n      children: [\n        Choice\u003cString\u003e.inline(\n          clearable: true,\n          value: ChoiceSingle.value(selectedValue),\n          onChanged: ChoiceSingle.onChanged(setSelectedValue),\n          itemCount: choices.length,\n          itemBuilder: (state, i) {\n            return ChoiceChip(\n              selected: state.selected(choices[i]),\n              onSelected: state.onSelected(choices[i]),\n              label: Text(choices[i]),\n            );\n          },\n          listBuilder: ChoiceList.createScrollable(\n            spacing: 10,\n            padding: const EdgeInsets.symmetric(\n              horizontal: 20,\n              vertical: 25,\n            ),\n          ),\n        ),\n        InlineChoice\u003cString\u003e.single(\n          clearable: true,\n          value: selectedValue,\n          onChanged: setSelectedValue,\n          itemCount: choices.length,\n          itemBuilder: (state, i) {\n            return ChoiceChip(\n              selected: state.selected(choices[i]),\n              onSelected: state.onSelected(choices[i]),\n              label: Text(choices[i]),\n            );\n          },\n          listBuilder: ChoiceList.createWrapped(\n            spacing: 10,\n            runSpacing: 10,\n            padding: const EdgeInsets.symmetric(\n              horizontal: 20,\n              vertical: 25,\n            ),\n          ),\n        ),\n      ],\n    );\n  }\n}\n```\n\n### Multiple Choice\n[![Preview](https://github.com/davigmacode/flutter_choice/raw/main/media/choice-multiple.gif)](https://davigmacode.github.io/flutter_choice)\n\nThere are a few constructors to create an multiple selection choice widget:\n* [`Choice.inline`](https://pub.dev/documentation/choice/latest/choice/Choice/Choice.inline.html)\n* [`InlineChoice`](https://pub.dev/documentation/choice/latest/choice_inline/InlineChoice/InlineChoice.html)\n* [`InlineChoice.multiple`](https://pub.dev/documentation/choice/latest/choice_inline/InlineChoice/InlineChoice.multiple.html)\n* [`PromptedChoice`](https://pub.dev/documentation/choice/latest/choice_prompt/PromptedChoice/PromptedChoice.html)\n* [`PromptedChoice.multiple`](https://pub.dev/documentation/choice/latest/choice_prompt/PromptedChoice/PromptedChoice.multiple.html)\n\n### Inline Choice\n[![Preview](https://github.com/davigmacode/flutter_choice/raw/main/media/choice-inline.gif)](https://davigmacode.github.io/flutter_choice)\n\nThere are a few constructors to create an inline choice widget:\n* [`Choice.inline`](https://pub.dev/documentation/choice/latest/choice/Choice/Choice.inline.html)\n* [`InlineChoice`](https://pub.dev/documentation/choice/latest/choice_inline/InlineChoice/InlineChoice.html)\n* [`InlineChoice.single`](https://pub.dev/documentation/choice/latest/choice_inline/InlineChoice/InlineChoice.single.html)\n* [`InlineChoice.multiple`](https://pub.dev/documentation/choice/latest/choice_inline/InlineChoice/InlineChoice.multiple.html)\n\n### Prompted Choice\n[![Preview](https://github.com/davigmacode/flutter_choice/raw/main/media/choice-prompt.gif)](https://davigmacode.github.io/flutter_choice)\n\nThere are a few constructors to create a prompted choice widget:\n* [`Choice.prompt`](https://pub.dev/documentation/choice/latest/choice/Choice/Choice.prompt.html)\n* [`PromptedChoice`](https://pub.dev/documentation/choice/latest/choice_prompt/PromptedChoice/PromptedChoice.html)\n* [`PromptedChoice.single`](https://pub.dev/documentation/choice/latest/choice_prompt/PromptedChoice/PromptedChoice.single.html)\n* [`PromptedChoice.multiple`](https://pub.dev/documentation/choice/latest/choice_prompt/PromptedChoice/PromptedChoice.multiple.html)\n\n### Choice Data\n[![Preview](https://github.com/davigmacode/flutter_choice/raw/main/media/choice-data.gif)](https://davigmacode.github.io/flutter_choice)\n\n### Choice Item\n[![Preview](https://github.com/davigmacode/flutter_choice/raw/main/media/choice-item.gif)](https://davigmacode.github.io/flutter_choice)\n\n### With Future Builder\n[![Preview](https://github.com/davigmacode/flutter_choice/raw/main/media/choice-future.gif)](https://davigmacode.github.io/flutter_choice)\n\n### With Form and FormField\n[![Preview](https://github.com/davigmacode/flutter_choice/raw/main/media/choice-form.gif)](https://davigmacode.github.io/flutter_choice)\n\n## TODO\n\n* :white_check_mark: Grouped choice items\n* :x: ~~Sortable choice items~~ better to do this outside\n* :black_square_button: Add scroll wheel list\n* :black_square_button: Add dropdown choice widget\n* :black_square_button: Add chainable choice widget\n\n## Sponsoring\n\n\u003ca href=\"https://www.buymeacoffee.com/davigmacode\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" height=\"45\"\u003e\u003c/a\u003e\n\u003ca href=\"https://ko-fi.com/davigmacode\" target=\"_blank\"\u003e\u003cimg src=\"https://storage.ko-fi.com/cdn/brandasset/kofi_s_tag_white.png\" alt=\"Ko-Fi\" height=\"45\"\u003e\u003c/a\u003e\n\nIf this package or any other package I created is helping you, please consider to sponsor me so that I can take time to read the issues, fix bugs, merge pull requests and add features to these packages.\n","funding_links":["https://github.com/sponsors/davigmacode","https://ko-fi.com/davigmacode","https://www.buymeacoffee.com/davigmacode"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavigmacode%2Fflutter_choice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavigmacode%2Fflutter_choice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavigmacode%2Fflutter_choice/lists"}