CustomDropdown<T>.searchRequest constructor

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

Implementation

const CustomDropdown.searchRequest({
  super.key,
  this.futureRequest,
  required this.onChanged,
  this.paginatedRequest,
  this.pageSize = 20,
  this.loadMoreIndicator,
  this.futureRequestDelay,
  this.searchRequestMinChars = 0,
  this.initialItem,
  this.items,
  this.controller,
  this.itemsScrollController,
  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.searchRequestLoadingIndicator,
  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(
        (futureRequest == null) != (paginatedRequest == null),
        'Provide exactly one of futureRequest or paginatedRequest',
      ),
      _searchType = _SearchType.onRequestData,
      _dropdownType = _DropdownType.singleSelect,
      initialItems = null,
      onListChanged = null,
      listValidator = null,
      headerListBuilder = null,
      multiSelectController = null;