DropdownFormField<T> class
Create a dropdown form field
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DropdownFormField
Constructors
-
DropdownFormField({Key? key, required ListTile dropdownItemFn(String item, int position, bool focused, bool selected, dynamic onTap()), required Widget displayItemFn(String? item), required DropDownFind findFn, FocusNode? focusNode, bool filterFn(String item, String str)?, bool autoFocus = false, bool isProduct = false, DropdownEditingController<
String> ? controller, String? validator(String?)?, InputDecoration? decoration, Color? dropdownColor, void onChanged(String item)?, void onSaved(String?)?, double? dropdownHeight, TextStyle? searchTextStyle, String emptyText = "No matching found!", String emptyActionText = 'Create new', Future<void> onEmptyActionPressed()?, bool selectedFn(String? item1, String? item2)?}) -
const
Properties
- autoFocus → bool
-
final
-
controller
→ DropdownEditingController<
String> ? -
final
- decoration → InputDecoration?
-
final
- displayItemFn → Widget Function(String? item)
-
Build widget to display selected item inside Form Field
final
- dropdownColor → Color?
-
final
- dropdownHeight → double?
-
height of the dropdown overlay, Default: 240
final
- dropdownItemFn → ListTile Function(String item, int position, bool focused, bool selected, dynamic onTap())
-
Build dropdown Items, it get called for all dropdown items
item
=dynamic value
List item to build dropdown ListtilelasSelectedItem
=null | dynamic value
last selected item, it gives user chance to highlight selected itemposition
=0,1,2...
Index of the list itemfocused
=true | false
is the item if focused, it gives user chance to highlight focused itemonTap
= Function *important! just assign this function to Listtile.onTap = onTap, incase you missed this, the click event if the dropdown item will not work.final - emptyActionText → String
-
Give action text if you want handle the empty search.
final
- emptyText → String
-
Message to disloay if the search dows not match with any item, Default : "No matching found!"
final
- filterFn → bool Function(String item, String str)?
-
It will trigger on user search
final
- findFn → DropDownFind
-
Return list of items what need to list for dropdown.
The list may be offline, or remote data from server.
final
- focusNode → FocusNode?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isProduct → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onChanged → void Function(String item)?
-
final
-
onEmptyActionPressed
→ Future<
void> Function()? -
this functon triggers on click of emptyAction button
final
- onSaved → void Function(String?)?
-
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(String? item1, String? item2)?
-
Check item is selectd
final
- validator → String? Function(String?)?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → DropdownFormFieldState -
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