DfSearchableDropdown<T> constructor
const
DfSearchableDropdown<T> ({
- Key? key,
- List<
DropDownModel< initData = const [],T> > - DropDownModel<
T> ? selectedValue, - String? labelText,
- String? hintText,
- dynamic onOptionSelected(
- DropDownModel<
T> ?
- DropDownModel<
- String? validator(
- DropDownModel<
T> ?
- DropDownModel<
- Future<
List< onSearch(DropDownModel< >T> >- String searchText
- DropdownDecoration? decoration,
- SimpleSelectorDecoration? selectorDecoration,
- Widget? arrowWidget,
- DropdownType dropdownType = DropdownType.expandable,
- bool disabled = false,
- bool closeOnTapOutside = true,
- bool rememberSelectedValue = true,
- Future<
List< ? asyncInitData,DropDownModel< >T> > - double expandableSelectorBottomMargin = 4,
Constructor for DfSearchableDropdown.
initData: Initial list of data for the dropdown.selectedValue: Currently selected value.labelText: Text for the label of the dropdown.hintText: Placeholder text shown when no value is selected.onOptionSelected: Callback function triggered when an option is selected.validator: Optional validation function for the dropdown selection.onSearch: Function to perform a search based on user input, returning a filtered list of dropdown options.decoration: Custom styling for the dropdown field.selectorDecoration: Additional custom styling for the dropdown selector.arrowWidget: Widget for the arrow icon displayed in the dropdown.dropdownType: Default value isDropdownType.expandable, and it's used to switch between the expandable, and the overlay appearance
Implementation
const DfSearchableDropdown({
super.key,
this.initData = const [],
this.selectedValue,
this.labelText,
this.hintText,
this.onOptionSelected,
this.validator,
this.onSearch,
this.decoration,
this.selectorDecoration,
this.arrowWidget,
this.dropdownType = DropdownType.expandable,
this.disabled = false,
this.closeOnTapOutside = true,
this.rememberSelectedValue = true,
this.asyncInitData,
this.expandableSelectorBottomMargin = 4,
}) : assert(initData.length == 0 || asyncInitData == null,
"initData and asyncInitData cannot be provided at the same time");