Closed raLaaaa closed 3 years ago
Hello @raLaaaa ,
If you want to display only the last selected item, you can use the selectedAggregateWidgetFn
for the searchable_dropdown
or the search_choices
plugin (example for search_choices
):
SearchChoices.multiple(
items: items,
selectedItems: selectedItemsMultiDialog,
onChanged: (value) {
setState(() {
selectedItemsMultiDialog = value;
});
},
isExpanded: true,
selectedAggregateWidgetFn: (List<Widget> list) {
return (list.isNotEmpty?list.last:SizedBox.shrink());
},
)
If you want to display the number of selected items instead of the selected items forboth plugins, you can use the same parameters as in below example:
SearchChoices.multiple(
items: items,
selectedItems: selectedItemsMultiDialog,
onChanged: (value) {
setState(() {
selectedItemsMultiDialog = value;
});
},
isExpanded: true,
selectedAggregateWidgetFn: (List<Widget> list) {
return (Text("${list.length} items selected"));
},
)
Thank you!
You’re welcome
See my screenshot:
I would like to hide blockchain and know-how and only show the dropdown field with the last selected item? Is that possible? I couldnt find an attribute for this.
Thank you!