Set State not working with MultiSelectBottomSheetField
Hi, I'm using MultiSelectBottomSheetField with other widgets that need setState like CheckboxListTile and Radio. When pressing the Radio button or checkBox ( or anything that is with setState ), it removes all the displaying item in the MultiSelectBottomSheetField. The variable still have the selected values but display all gone.
Hello,
I did try to reproduce this, but I'm not having the same problem. Can you provide a code example that reproduces the issue?
Hi Below is my code:
Under the stateful widget I declared the folowing variable.

Inside my Stateful widget -> body -> Form, I have a Future builder where future is "_getGroup", the variable declared in the first image to get API data. If snapshot has data, I convert the json data into list so that I can map it to MultiSelectItem. Then I do the MultiSelectBottomSheet as usual.

For your information, the ReportInfo class is as follows:

and this is how I get the _list

When I select the data, it looks like this:

but when I click on Radio / CheckBoxListTile, the chipDisplay is gone
I'm facing the same error when I use filtering search, it returns me setState error and clear all my selection.
Add the parameter key: GlobalKey() to your MultiSelectBottomSheetField and the setState will work
Source: https://github.com/CHB61/multi_select_flutter/issues/12#issuecomment-1051216159