FormBuilderSearchableDropdown<T> class

Field for selecting value(s) from a searchable list

Inheritance

Constructors

FormBuilderSearchableDropdown({Key? key, AutovalidateMode? autovalidateMode, bool enabled = true, FocusNode? focusNode, FormFieldSetter<T>? onSaved, FormFieldValidator<T>? validator, InputDecoration decoration = const InputDecoration(), required String name, T? initialValue, ValueChanged<T?>? onChanged, ValueTransformer<T?>? valueTransformer, VoidCallback? onReset, DropdownSearchOnFind<T>? asyncItems, AutovalidateMode? autoValidateMode, DropdownSearchCompareFn<T>? compareFn, DropdownSearchBuilder<T>? dropdownBuilder, InputDecoration? dropdownSearchDecoration, TextAlign? dropdownSearchTextAlign, TextAlignVertical? dropdownSearchTextAlignVertical, DropdownSearchFilterFn<T>? filterFn, DropdownSearchItemAsString<T>? itemAsString, List<T> items = const [], BeforeChange<T>? onBeforeChange, OnItemAdded<T>? popupOnItemAdded, OnItemRemoved<T>? popupOnItemRemoved, DropdownSearchPopupItemBuilder<T>? popupSelectionWidget, T? selectedItem, List<T> selectedItems = const [], PopupProps<T> popupProps = const PopupProps.menu(showSearchBox: true, fit: FlexFit.loose), ClearButtonProps? clearButtonProps, TextStyle? dropdownSearchTextStyle, DropdownButtonProps? dropdownButtonProps})
Creates field for selecting value(s) from a searchable list

Properties

asyncItems DropdownSearchOnFind<T>?
function that returns item from API
final
autoValidateMode AutovalidateMode?
final
autovalidateMode AutovalidateMode
Used to enable/disable this form field auto validation and update its error text.
finalinherited
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.
finalinherited
clearButtonProps ClearButtonProps?
custom dropdown clear button icon properties
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
finalinherited
to customize list of items UI
final
to customize list of items UI in MultiSelection mode
final
custom dropdown icon button properties
final
dropdownSearch input decoration
final
style on which to base the label How the text in the decoration should be aligned horizontally.
final
How the text should be aligned vertically.
final
style on which to base the label
final
enabled bool
Whether the form is able to receive user input.
finalinherited
filterFn DropdownSearchFilterFn<T>?
custom filter function
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
initialValue → T?
An optional value to initialize the form field to, or null otherwise.
finalinherited
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.
finalinherited
name String
Used to reference the field within the form, or to reference form data after the form is submitted.
finalinherited
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.
finalinherited
onChangedMultiSelection ValueChanged<List<T>>?
called when a new items are selected
final
onReset VoidCallback?
Called when the field value is reset.
finalinherited
onSaved FormFieldSetter<T>?
An optional method to call with the final value when the form is saved via FormState.save.
finalinherited
onSavedMultiSelection FormFieldSetter<List<T>>?
An optional method to call with the final value when the form is saved via
final
popupCustomMultiSelectionWidget ValidationMultiSelectionBuilder<T>?
widget to add custom widget like addAll/removeAll on popup multi selection mode
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
popupProps PopupProps<T>
final
popupSelectionWidget DropdownSearchPopupItemBuilder<T>?
widget used to show checked items in multiSelection mode
final
popupValidationMultiSelectionWidget ValidationMultiSelectionBuilder<T?>?
widget used to validate items in multiSelection mode
final
restorationId String?
Restoration ID to save and restore the state of the form field.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedItem → T?
selected item
final
selectedItems List<T>
selected 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.
finalinherited
valueTransformer → ValueTransformer<T?>?
Called just before field value is saved. Used to massage data just before committing the value.
finalinherited

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.
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}) 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