Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple selection inside the drop down menu in flutter

Hi In my App I have something like this.

this

where I have a dropdown which displaying 3 options, but is there any way I can select multiple options inside the dropdown in flutter? and to store the result of selected options inside the list?

or is it possible to do something like below in flutter?

enter image description here

Thanks.

like image 878
Mark12 Avatar asked Oct 09 '19 13:10

Mark12


1 Answers

You could achieve that by using a custom widget as a child of the DropdownMenuItem, where the custom widget would need to be stateful so it can handle it's own state to show a check mark or something. And it should have it's own onTap method, so the DropdownMenuItem onTap won't trigger and select the option, dismissing the dropdown. You will also need to have an option to finalize the selection.

But I reccommend you to look another approach for this case for a better usability, like a dialog where you can select multiple options: Is there an equivalent widget in flutter to the "select multiple" element in HTML

like image 73
Pablo Barrera Avatar answered Oct 04 '22 10:10

Pablo Barrera