DropdownFlutter<T>.search constructor

DropdownFlutter<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. CustomDropdownDecoration? decoration,
  9. dynamic visibility(
    1. bool
    )?,
  10. OverlayPortalController? overlayController,
  11. String? searchHintText,
  12. String? noResultFoundText,
  13. _ListItemBuilder<T>? listItemBuilder,
  14. _HeaderBuilder<T>? headerBuilder,
  15. _HintBuilder? hintBuilder,
  16. _NoResultFoundBuilder? noResultFoundBuilder,
  17. String? validator(
    1. T?
    )?,
  18. bool validateOnChange = true,
  19. int maxlines = 1,
  20. double? overlayHeight,
  21. EdgeInsets? closedHeaderPadding,
  22. EdgeInsets? expandedHeaderPadding,
  23. EdgeInsets? itemsListPadding,
  24. EdgeInsets? listItemPadding,
  25. double? listItemHeight,
  26. bool excludeSelected = true,
  27. bool canCloseOutsideBounds = true,
  28. bool hideSelectedFieldWhenExpanded = false,
  29. bool enabled = true,
  30. CustomDropdownDisabledDecoration? disabledDecoration,
  31. bool closeDropDownOnClearFilterSearch = false,
  32. Duration? animationDuration,
  33. Curve? animationCurve,
  34. bool enableHapticFeedback = false,
  35. String groupBy(
    1. T item
    )?,
  36. _GroupHeaderBuilder? groupHeaderBuilder,
  37. int recentSelectionsMaxCount = 0,
  38. List<T>? initialRecentItems,
  39. ValueChanged<List<T>>? onRecentItemsChanged,
  40. bool enableKeyboardNavigation = false,
  41. bool highlightMatchedText = false,
  42. bool showSelectAll = false,
  43. String? selectAllText,
  44. String? clearAllText,
})

Implementation

DropdownFlutter.search({
  super.key,
  required this.items,
  required this.onChanged,
  this.controller,
  this.itemsScrollController,
  this.initialItem,
  this.hintText,
  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.overlayHeight,
  this.closedHeaderPadding,
  this.expandedHeaderPadding,
  this.itemsListPadding,
  this.listItemPadding,
  this.listItemHeight,
  this.excludeSelected = true,
  this.canCloseOutsideBounds = true,
  this.hideSelectedFieldWhenExpanded = false,
  this.enabled = true,
  this.disabledDecoration,
  this.closeDropDownOnClearFilterSearch = false,
  this.animationDuration,
  this.animationCurve,
  this.enableHapticFeedback = false,
  this.groupBy,
  this.groupHeaderBuilder,
  this.recentSelectionsMaxCount = 0,
  this.initialRecentItems,
  this.onRecentItemsChanged,
  this.enableKeyboardNavigation = false,
  this.highlightMatchedText = false,
  this.showSelectAll = false,
  this.selectAllText,
  this.clearAllText,
})  : 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,
      initialItems = null,
      onListChanged = null,
      listValidator = null,
      headerListBuilder = null,
      searchRequestLoadingIndicator = null,
      multiSelectController = null;