SearchDropdownFormField<T> class

Create a dropdown form field

Inheritance

Constructors

SearchDropdownFormField({Key? key, required FormGroup form, required ListTile dropdownItemFn(T item, int position, bool focused, bool selected, dynamic onTap()), required Widget displayItemFn(T? item), required Future<List<T>> findFn(String str), bool filterFn(T item, String str)?, bool autoFocus = false, SearchDropdownEditingController<T>? controller, InputDecoration? decoration, Color? dropdownColor, void onChanged(T item)?, void onSaved(T?)?, double? dropdownHeight, TextStyle? searchTextStyle, Color? cursorColor, String emptyText = "No matching found!", String emptyActionText = 'Create new', Future<void> onEmptyActionPressed(String value)?, Widget? dropdownItemSeparator, bool selectedFn(T? item1, T? item2)?, void onFieldTap()?, required String formControlName, ShowErrorsFunction<T>? showErrors, bool enabled = true})
const

Properties

autoFocus bool
final
controller SearchDropdownEditingController<T>?
final
cursorColor Color?
Cursor color of the search box
final
decoration InputDecoration?
final
displayItemFn Widget Function(T? item)
Build widget to display selected item inside Form Field
final
final
height of the dropdown overlay, Default: 240
final
final
Separator between the dropdown items
final
emptyActionText String
Give action text if you want handle the empty search.
final
emptyText String
Message to display if the search does not match with any item, Default : "No matching found!"
final
enabled bool
final
filterFn bool Function(T item, String str)?
It will trigger on user search
final
findFn Future<List<T>> Function(String str)
Return list of items what need to list for dropdown.
final
form → FormGroup
final
formControlName String
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged → void Function(T item)?
final
onEmptyActionPressed Future<void> Function(String value)?
this function triggers on click of emptyAction button
final
onFieldTap → void Function()?
final
onSaved → void Function(T?)?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchTextStyle TextStyle?
Style the search box text
final
selectedFn bool Function(T? item1, T? item2)?
Check item is selected
final
showErrors → ShowErrorsFunction<T>?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() SearchDropdownFormFieldState
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.
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