DfSearchableMultiSelectDropdown<T> constructor

const DfSearchableMultiSelectDropdown<T>({
  1. Key? key,
  2. List<DropDownModel<T>>? selectedValues,
  3. Future<List<DropDownModel<T>>> onSearch(
    1. String searchText
    )?,
  4. MultiSelectorDecoration? selectorDecoration,
  5. List<DropDownModel<T>> initData = const [],
  6. String? labelText,
  7. String? hintText,
  8. dynamic onOptionSelected(
    1. List<DropDownModel<T>>
    )?,
  9. String? validator(
    1. List<DropDownModel<T>>?
    )?,
  10. DropdownDecoration? decoration,
  11. Widget? arrowWidget,
  12. DropdownType dropdownType = DropdownType.expandable,
  13. bool disabled = false,
  14. Future<List<DropDownModel<T>>>? asyncInitData,
  15. bool closeOnTapOutside = true,
  16. int? displayResultsCount,
})

Constructor for DfSearchableMultiSelectDropdown.

  • onOptionsSelected: Callback function triggered when options are selected.
  • multiSelectValidator: Optional validation function for dropdown selection.
  • onSearch: Function to perform a search based on user input. Returns a filtered list of dropdown options.
  • selectorDecoration: Additional custom styling for the dropdown selector.

Implementation

const DfSearchableMultiSelectDropdown({
  super.key,
  this.selectedValues,
  this.onSearch,
  this.selectorDecoration,
  super.initData = const [],
  super.labelText,
  super.hintText,
  Function(List<DropDownModel<T>>)? onOptionSelected,
  String? Function(List<DropDownModel<T>>?)? validator,
  super.decoration,
  super.arrowWidget,
  super.dropdownType = DropdownType.expandable,
  super.disabled = false,
  super.asyncInitData,
  super.closeOnTapOutside,
  this.displayResultsCount,
})  : onOptionsSelected = onOptionSelected,
      multiSelectValidator = validator,
      assert(initData.length == 0 || asyncInitData == null,
          "initData and asyncInitData cannot be provided at the same time");