Constructors
SelectFieldBase.new ({Key ? key , String ? label , TextStyle ? labelStyle , bool enabled = true , String ? unselectedString , Duration duration = const Duration(milliseconds: 300) , ScrollController ? scrollController , required List <SelectFieldOption <T > > options , bool closeOnSelect = true , String ? errorText , SelectTrailingBuilder ? trailingBuilder , BorderRadius ? borderRadius , bool ? filled , bool enableSearch = false , Color ? fillColor , bool overrideColor = false , List <InputFeedbackText > ? feedback , double ? maxWidth , TextStyle ? titleStyle , TextStyle ? optionTileStyle , EdgeInsets fieldPadding = const EdgeInsets.symmetric(vertical: 12, horizontal: 16) , void onSearchChange (String searchText )?, String ? searchHintText , TextInputType ? searchKeyboardType , bool searchAutocorrect = true , TextCapitalization searchTextCapitalization = TextCapitalization.none , bool collapsed = true , bool autoFocusOnExpanded = true , bool ensureVisibleOnNewOptions = true , void onTransitionEnds (SelectFieldCollapseState state )?, Widget iconBuilder (BuildContext context , Widget defaultChild , bool expanded )?, bool closeOnUnfocus = true , AnimatedStateListItemBuilder <SelectFieldOption <T > > ? optionsSeparatorBuilder , bool makeOverlay = false , double collapsibleHeight = 350 , })
const
Properties
autoFocusOnExpanded
→ bool
final
borderRadius
→ BorderRadius ?
Radius of the field
final
closeOnSelect
→ bool
If set to true
this will auto-close the field when a user select an option of the dropdown
final
closeOnUnfocus
→ bool
final
collapsed
→ bool
final
collapsibleHeight
→ double
The height of the collapsible widget that has the options.
final
duration
→ Duration
Modify the duration of the collapsing/uncollapsing animation
final
enabled
→ bool
If false, all gesture detection will be disabled, this also affects color and transparency of the field
final
enableSearch
→ bool
final
ensureVisibleOnNewOptions
→ bool
If true
, the select field will ensure that it is visible within its
scrollable parent whenever new options are provided. This is useful
for dynamically loaded options, ensuring the user can always see the
updated list without manual scrolling.
final
errorText
→ String ?
If you would like to show an error message this will render your message and change the background color of the field
final
feedback
→ List <InputFeedbackText > ?
If you would like to provide feedback for this field you can do so
final
fieldPadding
→ EdgeInsets
Provide a way to customize default field content padding
final
fillColor
→ Color ?
The Color to be used instead of the default one which is inherited from an InputTheme
final
filled
→ bool ?
If you would like to render this field with background color
final
hashCode
→ int
The hash code for this object.
no setter inherited
iconBuilder
→ Widget Function(BuildContext context , Widget defaultChild , bool expanded ) ?
final
key
→ Key ?
Controls how one widget replaces another widget in the tree.
final inherited
label
→ String ?
The label of this field
final
labelStyle
→ TextStyle ?
Define a custom style to be used in the label of the field
final
Provide a custom builder for wrapping the list menu
final
makeOverlay
→ bool
Make SelectField an overlay widget, this allows the inner dropdown to float
instead of expanding vertically.
final
maxWidth
→ double ?
Define max width constraints for this field
by default this going to fallback on Theme.decorationInputTheme.constraints
final
onSearchChange
→ void Function(String searchText ) ?
final
onTransitionEnds
→ void Function(SelectFieldCollapseState state ) ?
final
options
→ List <SelectFieldOption <T > >
Provide the options to be used
final
final
optionsSeparatorBuilder
→ AnimatedStateListItemBuilder <SelectFieldOption <T > > ?
Called, as needed, to build list item separator.
By default this just adds a divider
final
optionTileStyle
→ TextStyle ?
Provide a custom text style to be used on the option list tiles
final
overrideColor
→ bool
By default, specifying a fillColor will only apply on default state of th field, but will not override when this field change to an error state or disabled
this change that behavior
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
scrollController
→ ScrollController ?
Wether if you would like to implement a custom controller to be used on the option list-view
final
searchAutocorrect
→ bool
final
searchHintText
→ String ?
final
searchKeyboardType
→ TextInputType ?
final
searchTextCapitalization
→ TextCapitalization
final
titleStyle
→ TextStyle ?
Provide a custom text style to be used on the field title
final
trailingBuilder
→ SelectTrailingBuilder ?
This provides a useful builder to be used instead of the default one, useful if you would like to customize the style of the trailing icon on each option
final
unselectedString
→ String ?
This text is used when no option have been selected
final