CustomDropdown<T>.search constructor

CustomDropdown<T>.search({
  1. Key? key,
  2. required List<T>? items,
  3. required dynamic onChanged(
    1. T?
    )?,
  4. SingleSelectController<T?>? controller,
  5. ScrollController? itemsScrollController,
  6. T? initialItem,
  7. String? hintText,
  8. String? labelText,
  9. Widget? label,
  10. CustomDropdownDecoration? decoration,
  11. dynamic visibility(
    1. bool
    )?,
  12. OverlayPortalController? overlayController,
  13. String? searchHintText,
  14. String? noResultFoundText,
  15. _ListItemBuilder<T>? listItemBuilder,
  16. _HeaderBuilder<T>? headerBuilder,
  17. _HintBuilder? hintBuilder,
  18. _NoResultFoundBuilder? noResultFoundBuilder,
  19. String? validator(
    1. T?
    )?,
  20. bool validateOnChange = true,
  21. int maxlines = 1,
  22. TextAlign textAlign = TextAlign.start,
  23. double? overlayHeight,
  24. EdgeInsets? closedHeaderPadding,
  25. EdgeInsets? expandedHeaderPadding,
  26. EdgeInsets? itemsListPadding,
  27. EdgeInsets? listItemPadding,
  28. bool excludeSelected = true,
  29. bool canCloseOutsideBounds = true,
  30. bool hideSelectedFieldWhenExpanded = false,
  31. bool enabled = true,
  32. bool canClearSelection = false,
  33. bool selectOnItemTap = true,
  34. CustomDropdownAnimation animation = const CustomDropdownAnimation(),
  35. bool initiallyOpen = false,
  36. bool autofocusOnSearch = false,
  37. DropdownOverlayDirection overlayDirection = DropdownOverlayDirection.auto,
  38. CustomDropdownDisabledDecoration? disabledDecoration,
  39. bool closeDropDownOnClearFilterSearch = false,
})

Implementation

CustomDropdown.search({
  super.key,
  required this.items,
  required this.onChanged,
  this.controller,
  this.itemsScrollController,
  this.initialItem,
  this.hintText,
  this.labelText,
  this.label,
  this.decoration,
  this.visibility,
  this.overlayController,
  this.searchHintText,
  this.noResultFoundText,
  this.listItemBuilder,
  this.headerBuilder,
  this.hintBuilder,
  this.noResultFoundBuilder,
  this.validator,
  this.validateOnChange = true,
  this.maxlines = 1,
  this.textAlign = TextAlign.start,
  this.overlayHeight,
  this.closedHeaderPadding,
  this.expandedHeaderPadding,
  this.itemsListPadding,
  this.listItemPadding,
  this.excludeSelected = true,
  this.canCloseOutsideBounds = true,
  this.hideSelectedFieldWhenExpanded = false,
  this.enabled = true,
  this.canClearSelection = false,
  this.selectOnItemTap = true,
  this.animation = const CustomDropdownAnimation(),
  this.initiallyOpen = false,
  this.autofocusOnSearch = false,
  this.overlayDirection = DropdownOverlayDirection.auto,
  this.disabledDecoration,
  this.closeDropDownOnClearFilterSearch = false,
})  : assert(
        initialItem == null || controller == null,
        'Only one of initialItem or controller can be specified at a time',
      ),
      assert(
        initialItem == null || items!.contains(initialItem),
        'Initial item must match with one of the item in items list.',
      ),
      assert(
        controller == null ||
            controller.value == null ||
            items!.contains(controller.value),
        'Controller value must match with one of the item in items list.',
      ),
      _searchType = _SearchType.onListData,
      _dropdownType = _DropdownType.singleSelect,
      futureRequest = null,
      futureRequestDelay = null,
      searchRequestMinChars = 0,
      paginatedRequest = null,
      pageSize = 20,
      loadMoreIndicator = null,
      initialItems = null,
      onListChanged = null,
      listValidator = null,
      headerListBuilder = null,
      searchRequestLoadingIndicator = null,
      multiSelectController = null;