DfSearchableSingleSelectDropdown<T> constructor

const DfSearchableSingleSelectDropdown<T>({
  1. Key? key,
  2. List<DropDownModel<T>> initData = const [],
  3. DropDownModel<T>? selectedValue,
  4. String? labelText,
  5. String? hintText,
  6. dynamic onOptionSelected(
    1. DropDownModel<T>?
    )?,
  7. String? validator(
    1. DropDownModel<T>?
    )?,
  8. Future<List<DropDownModel<T>>> onSearch(
    1. String searchText
    )?,
  9. DropdownDecoration? decoration,
  10. SingleSelectorDecoration? selectorDecoration,
  11. Widget? arrowWidget,
  12. DropdownType dropdownType = DropdownType.expandable,
  13. bool disabled = false,
  14. bool closeDropdownOnSelection = true,
  15. Future<List<DropDownModel<T>>>? asyncInitData,
})
  • onSearch: Function to perform a search based on user input. Returns a filtered list of dropdown options.

Implementation

const DfSearchableSingleSelectDropdown({
  super.key,
  super.initData = const [],
  super.selectedValue,
  super.labelText,
  super.hintText,
  super.onOptionSelected,
  super.validator,
  this.onSearch,
  super.decoration,
  this.selectorDecoration,
  super.arrowWidget,
  super.dropdownType = DropdownType.expandable,
  super.disabled = false,
  this.closeDropdownOnSelection = true,
  super.asyncInitData,
}) : assert(initData.length == 0 || asyncInitData == null,
          "initData and asyncInitData cannot be provided at the same time");