SelectPicker class

A legacy Select Picker widget.

SelectPicker is now deprecated in favor of SelectPickerNew, which offers a generic interface, better UI, and built-in search capabilities.

Inheritance
Annotations
  • @Deprecated('Use SelectPickerNew instead for a more flexible and modern interface.')

Constructors

SelectPicker({Key? key, required String hint, required List<SelectPickerItem> list, required bool selectFirst, required dynamic onSelect(SelectPickerItem), SelectPickerInputStyle? selectPickerInputStyle, SelectPickerBottomSheetStyle? selectPickerBottomSheetStyle, SelectPickerInputSearchStyle? selectPickerInputSearchStyle, SelectPickerCardItemStyle? selectPickerCardItemStyle, SelectPickerTopSelectorStyle? selectPickerTopSelectorStyle, Future<List<SelectPickerItem>> onSearch(String? text)?, dynamic onClose()?, String? inputError, String? hintSearch, bool? showId, String? initialItem, bool? disabled, bool? isLoading, String? loadingMessage})
Creates a SelectPicker instance.
const

Properties

disabled bool?
Whether the picker is interactive.
final
hashCode int
The hash code for this object.
no setterinherited
hint String
The primary hint text shown on the selector.
final
hintSearch String?
The hint text for the search input in the bottom sheet.
final
initialItem String?
The initially selected item ID.
final
inputError String?
The error message to display below the input field.
final
isLoading bool?
Whether the widget is currently in a loading state.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
list List<SelectPickerItem>
The list of items available for selection.
final
loadingMessage String?
The message to display while loading.
final
onClose → dynamic Function()?
Callback executed when the picker sheet is closed.
final
onSearch Future<List<SelectPickerItem>> Function(String? text)?
Custom search function for asynchronous data loading.
final
onSelect → dynamic Function(SelectPickerItem)
Callback executed when an item is selected.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectFirst bool
Whether to automatically select the first item.
final
selectPickerBottomSheetStyle SelectPickerBottomSheetStyle?
Customization style for the bottom sheet.
final
selectPickerCardItemStyle SelectPickerCardItemStyle?
Customization style for each item in the list.
final
selectPickerInputSearchStyle SelectPickerInputSearchStyle?
Customization style for the search input field.
final
selectPickerInputStyle SelectPickerInputStyle?
Customization style for the input field.
final
selectPickerTopSelectorStyle SelectPickerTopSelectorStyle?
Customization style for the top header of the bottom sheet.
final
showId bool?
Whether to display the item ID in the list.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited