MultiSelect<T> constructor
const
MultiSelect<T> ({
- Key? key,
- ValueChanged<
Iterable< ? onChanged,T> ?> - Widget? placeholder,
- Widget? leading,
- Widget? trailing,
- Widget? indicatorIcon,
- bool filled = false,
- FocusNode? focusNode,
- BoxConstraints? constraints,
- BoxConstraints? popupConstraints,
- PopoverConstraint popupWidthConstraint = PopoverConstraint.anchorFixedSize,
- required Iterable<
T> ? value, - bool disableHoverEffect = false,
- BorderRadiusGeometry? borderRadius,
- EdgeInsetsGeometry? padding,
- AlignmentGeometry popoverAlignment = Alignment.topCenter,
- AlignmentGeometry? popoverAnchorAlignment,
- bool canUnselect = true,
- bool? autoClosePopover = false,
- bool? enabled,
- SelectValueSelectionHandler<
Iterable< ? valueSelectionHandler,T> > - SelectValueSelectionPredicate<
Iterable< ? valueSelectionPredicate,T> > - Predicate<
Iterable< ? showValuePredicate,T> > - Widget? expandIcon = const SelectExpandIcon(),
- required SelectPopupBuilder popup,
- required SelectValueBuilder<
T> itemBuilder,
Creates a multi-selection dropdown widget.
Allows selecting multiple items from a dropdown list, displaying them as chips.
The value, popup, and itemBuilder parameters are required.
Parameters:
key(Key?): Widget key for controlling widget identityonChanged(ValueChanged<Iterable<T>?>?): Callback when selection changes; if null, widget is disabledplaceholder(Widget?): Widget shown when no values are selectedleading(Widget?): Widget displayed before the selected values or placeholdertrailing(Widget?): Widget displayed after the selected values or placeholderindicatorIcon(Widget?): Widget displayed as the dropdown indicatorfilled(bool): Whether to use filled background style, defaults to falsefocusNode(FocusNode?): Focus node for keyboard interactionconstraints(BoxConstraints?): Size constraints for the select buttonpopupConstraints(BoxConstraints?): Size constraints for the popup menupopupWidthConstraint(PopoverConstraint): Width constraint mode for popup, defaults toPopoverConstraint.anchorFixedSizevalue(Iterable<T>): Required currently selected valuesdisableHoverEffect(bool): Whether to disable hover visual feedback, defaults to falseborderRadius(BorderRadiusGeometry?): Custom border radiuspadding(EdgeInsetsGeometry?): Custom paddingpopoverAlignment(AlignmentGeometry): Popup alignment, defaults toAlignment.topCenterpopoverAnchorAlignment(AlignmentGeometry?): Anchor alignment for popup positioningcanUnselect(bool): Whether user can deselect items, defaults to trueautoClosePopover(bool?): Whether popup closes after selection, defaults to falseenabled(bool?): Whether multi-select is enabled for interactionvalueSelectionHandler(SelectValueSelectionHandler<Iterable<T>>?): Custom selection logicvalueSelectionPredicate(SelectValueSelectionPredicate<Iterable<T>>?): Predicate for allowing selectionshowValuePredicate(Predicate<Iterable<T>>?): Predicate for showing itemspopup(SelectPopupBuilder): Required builder for popup contentitemBuilder(SelectValueBuilder<T>): Required builder for individual chip itemsexpandIcon(Widget): The expand icon for the select, defaults to SelectExpandIcon widget
Implementation
const MultiSelect({
super.key,
this.onChanged,
this.placeholder,
this.leading,
this.trailing,
this.indicatorIcon,
this.filled = false,
this.focusNode,
this.constraints,
this.popupConstraints,
this.popupWidthConstraint = PopoverConstraint.anchorFixedSize,
required this.value,
this.disableHoverEffect = false,
this.borderRadius,
this.padding,
this.popoverAlignment = Alignment.topCenter,
this.popoverAnchorAlignment,
this.canUnselect = true,
this.autoClosePopover = false,
this.enabled,
this.valueSelectionHandler,
this.valueSelectionPredicate,
this.showValuePredicate,
this.expandIcon = const SelectExpandIcon(),
required this.popup,
required SelectValueBuilder<T> itemBuilder,
}) : multiItemBuilder = itemBuilder;