DfSearchableDropdown<T> class
Constructors
-
DfSearchableDropdown.new({Key? key, List<DropDownModel<T>> initData = const [], DropDownModel<T>? selectedValue, String? labelText, String? hintText, dynamic onOptionSelected(DropDownModel<T>?)?, String? validator(DropDownModel<T>?)?, Future<List<DropDownModel<T>>> onSearch(String searchText)?, DropdownDecoration? decoration, SimpleSelectorDecoration? selectorDecoration, Widget? arrowWidget, DropdownType dropdownType = DropdownType.expandable, bool disabled = false, bool closeOnTapOutside = true, bool rememberSelectedValue = true, Future<List<DropDownModel<T>>>? asyncInitData})
-
Constructor for DfSearchableDropdown.
const
Properties
-
arrowWidget
→ Widget?
-
Widget displayed for the dropdown arrow icon.
final
-
asyncInitData
→ Future<List<DropDownModel<T>>>?
-
Future that provides the initial list of dropdown options.
final
-
closeOnTapOutside
→ bool
-
Selector widget will be
closed
when pressed outside of the field
final
-
decoration
→ DropdownDecoration?
-
Decoration for customizing the dropdown's appearance (e.g., border, padding, etc.).
final
-
disabled
→ bool
-
final
-
dropdownType
→ DropdownType
-
Default value is
DropdownType.expandable
, and it's used to switch between the expandable, and
the overlay appearance
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
hintText
→ String?
-
Placeholder text displayed when no value is selected.
final
-
initData
→ List<DropDownModel<T>>
-
Initial list of dropdown options.
final
-
key
→ Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
labelText
→ String?
-
The label text for the dropdown field.
final
-
onOptionSelected
→ dynamic Function(DropDownModel<T>?)?
-
Callback triggered when an option from the dropdown is selected.
final
-
onSearch
→ Future<List<DropDownModel<T>>> Function(String searchText)?
-
Function that performs the search operation based on the user's input. It returns a list of filtered options.
final
-
rememberSelectedValue
→ bool
-
Default is set to true, and if set to false, the selected value will not be remembered
when the dropdown is closed and reopened
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedValue
→ DropDownModel<T>?
-
The currently selected dropdown value.
final
-
selectorDecoration
→ SimpleSelectorDecoration?
-
Decoration for customizing the simple dropdown selector (e.g., background color, height, etc.).
final
-
validator
→ String? Function(DropDownModel<T>?)?
-
Provides a DropDownModel object if selected, and
null
if not
final