CustomDropdown<T> constructor

CustomDropdown<T>({
  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. String? validator(
    1. T?
    )?,
  12. bool validateOnChange = true,
  13. dynamic visibility(
    1. bool
    )?,
  14. OverlayPortalController? overlayController,
  15. _ListItemBuilder<T>? listItemBuilder,
  16. _HeaderBuilder<T>? headerBuilder,
  17. _HintBuilder? hintBuilder,
  18. int maxlines = 1,
  19. TextAlign textAlign = TextAlign.start,
  20. double? overlayHeight,
  21. EdgeInsets? closedHeaderPadding,
  22. EdgeInsets? expandedHeaderPadding,
  23. EdgeInsets? itemsListPadding,
  24. EdgeInsets? listItemPadding,
  25. bool canCloseOutsideBounds = true,
  26. bool hideSelectedFieldWhenExpanded = false,
  27. bool excludeSelected = true,
  28. bool enabled = true,
  29. bool canClearSelection = false,
  30. bool selectOnItemTap = true,
  31. CustomDropdownAnimation animation = const CustomDropdownAnimation(),
  32. bool initiallyOpen = false,
  33. bool autofocusOnSearch = false,
  34. DropdownOverlayDirection overlayDirection = DropdownOverlayDirection.auto,
  35. CustomDropdownDisabledDecoration? disabledDecoration,
})

Implementation

CustomDropdown({
  super.key,
  required this.items,
  required this.onChanged,
  this.controller,
  this.itemsScrollController,
  this.initialItem,
  this.hintText,
  this.labelText,
  this.label,
  this.decoration,
  this.validator,
  this.validateOnChange = true,
  this.visibility,
  this.overlayController,
  this.listItemBuilder,
  this.headerBuilder,
  this.hintBuilder,
  this.maxlines = 1,
  this.textAlign = TextAlign.start,
  this.overlayHeight,
  this.closedHeaderPadding,
  this.expandedHeaderPadding,
  this.itemsListPadding,
  this.listItemPadding,
  this.canCloseOutsideBounds = true,
  this.hideSelectedFieldWhenExpanded = false,
  this.excludeSelected = true,
  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,
})  : 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 = null,
      _dropdownType = _DropdownType.singleSelect,
      futureRequest = null,
      futureRequestDelay = null,
      searchRequestMinChars = 0,
      paginatedRequest = null,
      pageSize = 20,
      loadMoreIndicator = null,
      noResultFoundBuilder = null,
      noResultFoundText = null,
      searchHintText = null,
      initialItems = null,
      onListChanged = null,
      listValidator = null,
      headerListBuilder = null,
      searchRequestLoadingIndicator = null,
      closeDropDownOnClearFilterSearch = false,
      multiSelectController = null;