Select<T> constructor
const
Select<T> ({
- Key? key,
- ValueChanged<
T?> ? onChanged, - Widget? placeholder,
- bool filled = false,
- FocusNode? focusNode,
- BoxConstraints? constraints,
- BoxConstraints? popupConstraints,
- OverlayConfiguration? overlayConfiguration,
- T? value,
- bool disableHoverEffect = false,
- BorderRadiusGeometry? borderRadius,
- EdgeInsetsGeometry? padding,
- WidgetStatePropertyDelegate<
Decoration> ? decoration, - bool canUnselect = false,
- bool? autoClosePopover = true,
- bool? enabled,
- SelectValueSelectionHandler<
T> ? valueSelectionHandler, - SelectValueSelectionPredicate<
T> ? valueSelectionPredicate, - Predicate<
T> ? showValuePredicate, - Widget? expandIcon = const SelectExpandIcon(),
- required SelectPopupBuilder popup,
- required SelectValueBuilder<
T> itemBuilder, - bool? adaptiveOverlay,
Creates a single-selection dropdown widget.
The popup and itemBuilder parameters are required to define the
dropdown content and how selected values are displayed.
Parameters:
key(Key?): Widget key for controlling widget identityonChanged(ValueChanged<T?>?): Callback when selection changes; if null, select is disabledplaceholder(Widget?): Widget shown when no value is selectedfilled(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 menuoverlayConfiguration(OverlayConfiguration?): overrides the popup presentationvalue(T?): Currently selected valuedisableHoverEffect(bool): Whether to disable hover visual feedback, defaults to falseborderRadius(BorderRadiusGeometry?): Custom border radiuspadding(EdgeInsetsGeometry?): Custom paddingdecoration(WidgetStatePropertyDelegate<Decoration>?): Per-state override of the trigger decorationcanUnselect(bool): Whether user can deselect current value, defaults to falseautoClosePopover(bool?): Whether popup closes after selection, defaults to trueenabled(bool?): Whether select is enabled for interactionvalueSelectionHandler(SelectValueSelectionHandler<T>?): Custom selection logicvalueSelectionPredicate(SelectValueSelectionPredicate<T>?): Predicate for allowing selectionshowValuePredicate(Predicate<T>?): Predicate for showing itemspopup(SelectPopupBuilder): Required builder for popup contentitemBuilder(SelectValueBuilder<T>): Required builder for selected value displayexpandIcon(Widget): The expand icon for the select, defaults to SelectExpandIcon widgetadaptiveOverlay(bool?): whetheradaptiveConversionruns for this overlay
Implementation
const Select({
super.key,
this.onChanged,
this.placeholder,
this.filled = false,
this.focusNode,
this.constraints,
this.popupConstraints,
this.overlayConfiguration,
this.value,
this.disableHoverEffect = false,
this.borderRadius,
this.padding,
this.decoration,
this.canUnselect = false,
this.autoClosePopover = true,
this.enabled,
this.valueSelectionHandler,
this.valueSelectionPredicate,
this.showValuePredicate,
this.expandIcon = const SelectExpandIcon(),
required this.popup,
required this.itemBuilder,
this.adaptiveOverlay,
});