Skip to content
pubscout

multiselect_formfield

0.1.7, released 5 years ago by an unverified publisher

A multi-select form field using an alert dialog with checkboxes and chips.

WASM-ready
$ flutter pub add multiselect_formfield
Source repository

What it does

Provides a FormField implementation that lets users select multiple items from a list via an alert dialog containing checkboxes. The selected items are then displayed as removable chips inside the form field, supporting validation and data saving.

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

Use it when

  • You need a multi-selection input inside a Flutter Form.
  • You want selected options to be displayed as chips.

Skip it when

  • You need a deeply customized dropdown instead of an alert dialog.
  • You are not using Flutter's Form system.

Strengths

  • Integrates easily with Flutter's Form validation and state management.
  • Supports null safety.
  • Provides customization for chips, dialog shapes, and text styles.

Weaknesses

  • Relies on an alert dialog for selection, which may not fit all UI/UX designs.
  • Limited to a basic list of maps for data source configuration.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
MultiSelectFormField(
  autovalidate: false,
  chipBackGroundColor: Colors.red,
  chipLabelStyle: TextStyle(fontWeight: FontWeight.bold),
  dialogTextStyle: TextStyle(fontWeight: FontWeight.bold),
  checkBoxActiveColor: Colors.red,
  checkBoxCheckColor: Colors.green,
  dialogShapeBorder: RoundedRectangleBorder(
      borderRadius: BorderRadius.all(Radius.circular(12.0))),
  title: Text(
    "Title Of Form",
    style: TextStyle(fontSize: 16),
  ),
  dataSource: [
    {
      "display": "Running",
      "value": "Running",
    },
    {
      "display": "Climbing",
      "value": "Climbing",
    },
  ],
  textField: 'display',
  valueField: 'value',
  okButtonLabel: 'OK',
  cancelButtonLabel: 'CANCEL',
  hintWidget: Text('Please choose one or more'),
  initialValue: _myActivities,
  onSaved: (value) {
    if (value == null) return;
    setState(() {
      _myActivities = value;
    });
  },
)

Alternatives

Packages that do the same job and could replace multiselect_formfield.