Closed Pranavantariot closed 1 year ago
i have the same problem, how to deal it?
i have the same problem, how to deal it?
@hycinth ... If I have understood your problem correctly then, the constructor of the multi select widget is const and its a stateful widget so you will not see the difference until its marked as dirty and rebuilds. Try providing UniqueKey() for the multi select widget.
The below code works for me you need to render the widget after API call hope this will solve your problem
details.isEmpty?
null :
MultiSelectDropdown.simpleList(
list: details.map((e) => e.name) .toList(),
initiallySelected: selectedDetails.map((e) => e.name).toList(),
includeSelectAll: true,
isLarge: false,
textStyle: const TextStyle(fontSize: 14,overflow: TextOverflow.ellipsis),
splashColor: Colors.transparent,
onChange: (newList) {
// your logic
// typically setting state
},
width: 180,
numberOfItemsLabelToShow: 2, // label to be shown for 2 items
padding: EdgeInsets.zero,
whenEmpty: 'Select Note', // text to show when selected list is empty
boxDecoration: BoxDecoration( border: Border.all( color: Colors.transparent), borderRadius: BorderRadius.circular(0),),),
hi i wanted to provide a non-const list to the list parameter but after providing a non-const list the dropdown is not generating