cetorres / multiselect_formfield

A Flutter package that provides a multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.
BSD 3-Clause "New" or "Revised" License
72 stars 59 forks source link

Set Pre-selected values #5

Closed LenvZyl closed 4 years ago

LenvZyl commented 5 years ago

How does one have values preselected when the Widget is built. Setting value only returns an Error and initialValue only takes an int.

cetorres commented 4 years ago

To set pre selected values, pass an array (List) of the same type of the values of the field to the value property. I'm using it in another app and it's working. I'll update the example to show that.

abdulwahid24 commented 4 years ago

@cetorres Would you please provide an example of how exactly we can have pre-selected data.

guit4eva commented 4 years ago

@cetorres Would you please provide an example of how exactly we can have pre-selected data.

example: initialValue: ["Running"]