FormBuilderSearchableDropdown<T> class Null safety

Field for selecting value(s) from a searchable list

Inheritance

Constructors

FormBuilderSearchableDropdown({Key? key, required String name, FormFieldValidator<T>? validator, T? initialValue, InputDecoration decoration = const InputDecoration(), ValueChanged<T?>? onChanged, ValueTransformer<T?>? valueTransformer, bool enabled = true, FormFieldSetter<T>? onSaved, AutovalidateMode autovalidateMode = AutovalidateMode.disabled, VoidCallback? onReset, FocusNode? focusNode, required List<T>? items, Mode mode = dropdown_search.Mode.MENU, bool isFilteredOnline = false, Widget? popupTitle, T? selectedItem, DropdownSearchOnFind<T>? onFind, DropdownSearchBuilder<T>? dropdownBuilder, DropdownSearchPopupItemBuilder<T>? popupItemBuilder, bool showSearchBox = true, bool showClearButton = false, Color? popupBackgroundColor, double? maxHeight, DropdownSearchFilterFn<T>? filterFn, DropdownSearchItemAsString<T>? itemAsString, DropdownSearchCompareFn<T>? compareFn, EmptyBuilder? emptyBuilder, LoadingBuilder? loadingBuilder, ErrorBuilder? errorBuilder, double? dialogMaxWidth, Widget? clearButton, Widget? dropDownButton, bool dropdownBuilderSupportsNullItem = false, ShapeBorder? popupShape, DropdownSearchPopupItemEnabled<T>? popupItemDisabled, Color? popupBarrierColor, IconButtonBuilder? clearButtonBuilder, IconButtonBuilder? dropdownButtonBuilder, FavoriteItemsBuilder<T>? favoriteItemBuilder, FavoriteItems<T>? favoriteItems, BeforeChange<T>? onBeforeChange, MainAxisAlignment? favoriteItemsAlignment = MainAxisAlignment.start, VoidCallback? onPopupDismissed, Duration? searchDelay, bool showAsSuffixIcons = false, bool showFavoriteItems = false, List<T> selectedItems = const [], ValueChanged<List<T>>? onChangedMultiSelection, DropdownSearchBuilderMultiSelection<T>? dropdownBuilderMultiSelection, bool showSelectedItems = false, InputDecoration? dropdownSearchDecoration, TextStyle? dropdownSearchBaseStyle, TextAlign? dropdownSearchTextAlign, TextAlignVertical? dropdownSearchTextAlignVertical, AutovalidateMode? autoValidateMode, FormFieldSetter<List<T>>? onSavedMultiSelection, double? clearButtonSplashRadius, double? dropdownButtonSplashRadius, BeforeChangeMultiSelection<T>? onBeforeChangeMultiSelection, PopupSafeAreaProps popupSafeArea = const PopupSafeAreaProps(), TextFieldProps? searchFieldProps, ScrollbarProps? scrollbarProps, bool popupBarrierDismissible = true, bool isMultiSelectionMode = false, OnItemAdded<T>? popupOnItemAdded, OnItemRemoved<T>? popupOnItemRemoved, DropdownSearchPopupItemBuilder<T>? popupSelectionWidget, ValidationMultiSelectionBuilder<T?>? popupValidationMultiSelectionWidget, double popupElevation = 0, PositionCallback? positionCallback})
Creates field for selecting value(s) from a searchable list

Properties

autovalidate bool
Used to enable/disable auto validation and update their error text.
@Deprecated('Use autovalidateMode parameter which provides more specific ' 'behavior related to auto validation. ' 'This feature was deprecated after v1.19.0.'), final, inherited
autoValidateMode AutovalidateMode?
final
autovalidateMode AutovalidateMode
Used to enable/disable this form field auto validation and update its error text. [...]
final, inherited
builder FormFieldBuilder<T>
Function that returns the widget representing this form field. It is passed the form field state as input, containing the current value and validation state of this field.
final, inherited
clearButton Widget?
custom dropdown clear button icon widget
final
clearButtonBuilder IconButtonBuilder?
custom clear button widget builder
final
clearButtonSplashRadius double?
custom splash radius for the clear button If null, default splash radius of icon_button is used.
final
compareFn DropdownSearchCompareFn<T>?
function that compares two object with the same type to detected if it's the selected item or not
final
decoration InputDecoration
The border, labels, icons, and styles used to decorate the field.
final, inherited
dialogMaxWidth double?
the max width for the dialog
final
to customize list of items UI
final
to customize list of items UI in MultiSelection mode
final
If true, the dropdownBuilder will continue the uses of material behavior This will be useful if you want to handle a custom UI only if the item !=null
final
custom dropdown icon button widget
final
custom dropdown button widget builder
final
custom splash radius for the dropdown button If null, default splash radius of icon_button is used.
final
style on which to base the label
final
dropdownSearch input decoration
final
How the text in the decoration should be aligned horizontally.
final
How the text should be aligned vertically.
final
emptyBuilder EmptyBuilder?
custom layout for empty results
final
enabled bool
Whether the form is able to receive user input. [...]
final, inherited
errorBuilder ErrorBuilder?
custom layout for error
final
favoriteItemBuilder FavoriteItemsBuilder<T>?
to customize favorites chips
final
favoriteItems FavoriteItems<T>?
favorites items list
final
favoriteItemsAlignment MainAxisAlignment?
favorite items alignment
final
filterFn DropdownSearchFilterFn<T>?
custom filter function
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget. [...]
final, inherited
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
initialValue → T?
An optional value to initialize the form field to, or null otherwise.
final, inherited
isFilteredOnline bool
true if the filter on items is applied onlie (via API)
final
isMultiSelectionMode bool
define whatever we are in multi selection mode or single selection mode
final
itemAsString DropdownSearchItemAsString<T>?
customize the fields the be shown
final
items List<T>?
offline items list
final
key Key?
Controls how one widget replaces another widget in the tree. [...]
final, inherited
loadingBuilder LoadingBuilder?
custom layout for loading items
final
maxHeight double?
the max height for dialog/bottomSheet/Menu
final
mode Mode
MENU / DIALOG/ BOTTOM_SHEET
final
name String
Used to reference the field within the form, or to reference form data after the form is submitted.
final, inherited
onBeforeChange BeforeChange<T>?
callback executed before applying value change
final
onBeforeChangeMultiSelection BeforeChangeMultiSelection<T>?
callback executed before applying values changes
final
onChanged ValueChanged<T?>?
Called when the field value is changed.
final, inherited
onChangedMultiSelection ValueChanged<List<T>>?
called when a new items are selected
final
onFind DropdownSearchOnFind<T>?
function that returns item from API
final
onPopupDismissed VoidCallback?
called when popup is dismissed
final
onReset VoidCallback?
Called when the field value is reset.
final, inherited
onSaved FormFieldSetter<T>?
An optional method to call with the final value when the form is saved via FormState.save.
final, inherited
onSavedMultiSelection FormFieldSetter<List<T>>?
An optional method to call with the final value when the form is saved via
final
popupBackgroundColor Color?
the title for dialog/menu/bottomSheet
final
popupBarrierColor Color?
set a custom color for the popup barrier
final
popupBarrierDismissible bool
whether modal can be dismissed by tapping the modal barrier
final
popupElevation double
elevation for popup items
final
popupItemBuilder DropdownSearchPopupItemBuilder<T>?
to customize selected item
final
popupItemDisabled DropdownSearchPopupItemEnabled<T>?
defines if an item of the popup is enabled or not, if the item is disabled, it cannot be clicked
final
popupOnItemAdded OnItemAdded<T>?
called when a new item added on Multi selection mode
final
popupOnItemRemoved OnItemRemoved<T>?
called when a new item added on Multi selection mode
final
popupSafeArea PopupSafeAreaProps
set properties of popup safe area
final
popupSelectionWidget DropdownSearchPopupItemBuilder<T>?
widget used to show checked items in multiSelection mode
final
popupShape ShapeBorder?
custom shape for the popup
final
popupTitle Widget?
custom widget for the popup title
final
popupValidationMultiSelectionWidget ValidationMultiSelectionBuilder<T?>?
widget used to validate items in multiSelection mode
final
positionCallback PositionCallback?
function to override position calculation
final
restorationId String?
Restoration ID to save and restore the state of the form field. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scrollbarProps ScrollbarProps?
scrollbar properties
final
searchDelay Duration?
callback executed before applying value change delay before searching, change it to Duration(milliseconds: 0) if you do not use online search
final
searchFieldProps TextFieldProps?
object that passes all props to search field
final
selectedItem → T?
selected item
final
selectedItems List<T>
selected items
final
showAsSuffixIcons bool
whether to manage the clear and dropdown icons via InputDecoration suffixIcon
final
showClearButton bool
show/hide clear selected item
final
showFavoriteItems bool
show or hide favorites items
final
showSearchBox bool
show/hide the search box
final
showSelectedItems bool
select the selected item in the menu/dialog/bottomSheet of items
final
validator FormFieldValidator<T>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise. [...]
final, inherited
valueTransformer ValueTransformer<T?>?
Called just before field value is saved. Used to massage data just before committing the value. [...]
final, inherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
createState() → _FormBuilderSearchableDropdownState<T>
Creates the mutable state for this widget at a given location in the tree. [...]
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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}) 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. [...]
@nonVirtual, inherited