CustomDropdown<T>.multiSelect constructor

CustomDropdown<T>.multiSelect({
  1. Key? key,
  2. required List<T>? items,
  3. required dynamic onListChanged(
    1. List<T>
    )?,
  4. MultiSelectController<T>? multiSelectController,
  5. SingleSelectController<T?>? controller,
  6. List<T>? initialItems,
  7. OverlayPortalController? overlayController,
  8. ScrollController? itemsScrollController,
  9. String? listValidator(
    1. List<T>
    )?,
  10. dynamic visibility(
    1. bool
    )?,
  11. _HeaderListBuilder<T>? headerListBuilder,
  12. String? hintText,
  13. String? labelText,
  14. Widget? label,
  15. CustomDropdownDecoration? decoration,
  16. bool validateOnChange = true,
  17. _ListItemBuilder<T>? listItemBuilder,
  18. _HintBuilder? hintBuilder,
  19. bool canCloseOutsideBounds = true,
  20. bool hideSelectedFieldWhenExpanded = false,
  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 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.multiSelect({
  super.key,
  required this.items,
  required this.onListChanged,
  this.multiSelectController,
  this.controller,
  this.initialItems,
  this.overlayController,
  this.itemsScrollController,
  this.listValidator,
  this.visibility,
  this.headerListBuilder,
  this.hintText,
  this.labelText,
  this.label,
  this.decoration,
  this.validateOnChange = true,
  this.listItemBuilder,
  this.hintBuilder,
  this.canCloseOutsideBounds = true,
  this.hideSelectedFieldWhenExpanded = false,
  this.maxlines = 1,
  this.textAlign = TextAlign.start,
  this.overlayHeight,
  this.closedHeaderPadding,
  this.expandedHeaderPadding,
  this.itemsListPadding,
  this.listItemPadding,
  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(
        initialItems == null || multiSelectController == null,
        'Only one of initialItems or controller can be specified at a time',
      ),
      assert(
        initialItems == null ||
            initialItems.isEmpty ||
            initialItems.any((e) => items!.contains(e)),
        'Initial items must match with the items in the items list.',
      ),
      assert(
        multiSelectController == null ||
            multiSelectController.value.isEmpty ||
            multiSelectController.value.any((e) => items!.contains(e)),
        'Controller value must match with one of the item in items list.',
      ),
      _searchType = null,
      _dropdownType = _DropdownType.multipleSelect,
      initialItem = null,
      noResultFoundText = null,
      validator = null,
      headerBuilder = null,
      onChanged = null,
      excludeSelected = false,
      futureRequest = null,
      futureRequestDelay = null,
      searchRequestMinChars = 0,
      paginatedRequest = null,
      pageSize = 20,
      loadMoreIndicator = null,
      noResultFoundBuilder = null,
      searchHintText = null,
      searchRequestLoadingIndicator = null,
      closeDropDownOnClearFilterSearch = false;