Select<T> constructor

const Select<T>({
  1. Key? key,
  2. ValueChanged<T?>? onChanged,
  3. Widget? placeholder,
  4. bool filled = false,
  5. FocusNode? focusNode,
  6. BoxConstraints? constraints,
  7. BoxConstraints? popupConstraints,
  8. OverlayConfiguration? overlayConfiguration,
  9. T? value,
  10. bool disableHoverEffect = false,
  11. BorderRadiusGeometry? borderRadius,
  12. EdgeInsetsGeometry? padding,
  13. WidgetStatePropertyDelegate<Decoration>? decoration,
  14. bool canUnselect = false,
  15. bool? autoClosePopover = true,
  16. bool? enabled,
  17. SelectValueSelectionHandler<T>? valueSelectionHandler,
  18. SelectValueSelectionPredicate<T>? valueSelectionPredicate,
  19. Predicate<T>? showValuePredicate,
  20. Widget? expandIcon = const SelectExpandIcon(),
  21. required SelectPopupBuilder popup,
  22. required SelectValueBuilder<T> itemBuilder,
  23. 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 identity
  • onChanged (ValueChanged<T?>?): Callback when selection changes; if null, select is disabled
  • placeholder (Widget?): Widget shown when no value is selected
  • filled (bool): Whether to use filled background style, defaults to false
  • focusNode (FocusNode?): Focus node for keyboard interaction
  • constraints (BoxConstraints?): Size constraints for the select button
  • popupConstraints (BoxConstraints?): Size constraints for the popup menu
  • overlayConfiguration (OverlayConfiguration?): overrides the popup presentation
  • value (T?): Currently selected value
  • disableHoverEffect (bool): Whether to disable hover visual feedback, defaults to false
  • borderRadius (BorderRadiusGeometry?): Custom border radius
  • padding (EdgeInsetsGeometry?): Custom padding
  • decoration (WidgetStatePropertyDelegate<Decoration>?): Per-state override of the trigger decoration
  • canUnselect (bool): Whether user can deselect current value, defaults to false
  • autoClosePopover (bool?): Whether popup closes after selection, defaults to true
  • enabled (bool?): Whether select is enabled for interaction
  • valueSelectionHandler (SelectValueSelectionHandler<T>?): Custom selection logic
  • valueSelectionPredicate (SelectValueSelectionPredicate<T>?): Predicate for allowing selection
  • showValuePredicate (Predicate<T>?): Predicate for showing items
  • popup (SelectPopupBuilder): Required builder for popup content
  • itemBuilder (SelectValueBuilder<T>): Required builder for selected value display
  • expandIcon (Widget): The expand icon for the select, defaults to SelectExpandIcon widget
  • adaptiveOverlay (bool?): whether adaptiveConversion runs 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,
});