TaimoorHassan / multiselect

A simple DropDown widget with multiselect enabled by default
https://pub.dev/packages/multiselect
BSD 3-Clause "New" or "Revised" License
10 stars 64 forks source link

Overflowing RenderFlex with long Texts in Options #16

Open LPlenk opened 2 years ago

LPlenk commented 2 years ago

My Dropdown has some long texts in the options. With the normal DropdownButtonFormField it is possible to set a attribute called isExpanded to true in order to get more lines in the options. Unfortunately I cannot find something similar in the MultiselectDropDown Widget. This causes an overflowing RenderFlex in my code.

Is it possible to add an attribute for that? Thanks in advance.

debjeetproso commented 2 years ago

I am having still a problem getting overflowing render flex error

CA2puntosV commented 1 year ago

I had the same problem, but I forked the project and tried to solve the error, and I opened a pull request for that, but for now you could do someting like this import in your pubspec.yaml

  multiselect:
    git:
      url: https://github.com/CA2puntosV/multiselect.git
      ref: text_items_customization
kuronob10 commented 11 months ago

U can use childBuilder for show value.

DropDownMultiSelect( onChanged: (value) { setState(() { selected = value; }); }, options: listOfValue, selectedValues: selected, childBuilder: (selectedValues) { return Padding( padding: const EdgeInsets.only(left: 20), child: Text(selectedValues.isNotEmpty ? '${selectedValues.length} Selected' : ''), ); }, decoration: inputStyleModal('Employee'), )