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
71 stars 58 forks source link

initialValue on MultiSelectFormField not working! #19

Open jabedbd opened 4 years ago

jabedbd commented 4 years ago

I have tried to set initialValue value on MultiSelectFormField. but it's not working.

My dataset was like: dataSource: [ { "display": "Running", "value": "1", } ]

And the initialValue is set to [1]

jtmuller5 commented 4 years ago

You need to set the initialValue to ["1"] for it to recognize it.

david-kalbermatten commented 3 years ago

To elaborate on @jtmuller5's answer... If you set dataSource: [ { "display": "Running", "value": "1", } ], your "value" will be of type String. This means you need to match the type in your initalValue-List.