Skip to content
pubscout

choice

2.3.2, released 3 years ago by widgetarian.com

Create single or multiple choice inline and prompted widgets in Flutter.

WASM-ready
$ flutter pub add choice
Source repository

What it does

Choice provides a flexible, composable API for building single or multiple choice selection widgets. It supports inline lists (wrapped, scrollable) and prompted modals (dialogs, bottom sheets, new pages) with features like searching, grouping, and asynchronous data loading.

AI-written summary of version 2.3.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need custom single or multi-select chips, lists, or dropdown alternatives.
  • You want prompted selection modals (bottom sheets or dialogs) with built-in search.

Skip it when

  • You are using native form dropdown fields that do not require advanced composability or inline chip groups.
  • You need a full form validation engine rather than just selection widgets.

Strengths

  • Supports both inline and prompted choice displays.
  • Highly composable API allowing custom builders for items, lists, anchors, and modals.
  • Handles both single and multiple selection natively.

Weaknesses

  • Sorting items must be handled outside the package.
  • Some complex widget combinations require understanding multiple specific constructors.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
Choice<String>.inline(
  clearable: true,
  value: ChoiceSingle.value(selectedValue),
  onChanged: ChoiceSingle.onChanged(setSelectedValue),
  itemCount: choices.length,
  itemBuilder: (state, i) {
    return ChoiceChip(
      selected: state.selected(choices[i]),
      onSelected: state.onSelected(choices[i]),
      label: Text(choices[i]),
    );
  },
  listBuilder: ChoiceList.createScrollable(
    spacing: 10,
  ),
)

Alternatives

Packages that do the same job and could replace choice.