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

Added max selections variable #20

Closed JupiterThreads closed 2 months ago

JupiterThreads commented 4 years ago

I needed to be able to control how many options a user can select before they click ok. In my use case the validation wasn't sufficient because if a user selected quite a few options and they return to my widget, they wouldn't be able see the validation message telling them that they've selected too many options. In my widget I limited the size of the multiselect_formfield so it doesn't take up the whole page. In any event, I think it provides a better user experience if they are only allowed to select a certain number of items over a validation message.

Also fixed no such method error when data source is empty when data source is coming from a future and selected options display where existing item is null.

Set a key to field to prevent flutter from using previous state when initial values are changed. The data I have to display and what is being selected can be changed frequently so I need to wipe prev state.

cetorres commented 4 years ago

Please fix the conflict, so I can merge your PR. Thank you.

JupiterThreads commented 4 years ago

There seems to be a bug somewhere. Every time I make a selection the alert is popping off and the values are not being fed back. I am looking into it.

JupiterThreads commented 4 years ago

It seems it was some flutter version build problem. Seems to work fine now.

JupiterThreads commented 3 years ago

Are your going to merge this in? I don’t want to fix more conflicts for it to be left. Thanks

cetorres commented 3 years ago

Hi @JupiterThreads, please fix the conflict first then I can merge it. Thanks.