DropdownFlutter<T> constructor

DropdownFlutter<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. CustomDropdownDecoration? decoration,
  9. String? validator(
    1. T?
    )?,
  10. bool validateOnChange = true,
  11. dynamic visibility(
    1. bool
    )?,
  12. OverlayPortalController? overlayController,
  13. _ListItemBuilder<T>? listItemBuilder,
  14. _HeaderBuilder<T>? headerBuilder,
  15. _HintBuilder? hintBuilder,
  16. int maxlines = 1,
  17. double? overlayHeight,
  18. EdgeInsets? closedHeaderPadding,
  19. EdgeInsets? expandedHeaderPadding,
  20. EdgeInsets? itemsListPadding,
  21. EdgeInsets? listItemPadding,
  22. bool canCloseOutsideBounds = true,
  23. bool hideSelectedFieldWhenExpanded = false,
  24. bool excludeSelected = true,
  25. bool enabled = true,
  26. CustomDropdownDisabledDecoration? disabledDecoration,
})

Implementation

DropdownFlutter({
  super.key,
  required this.items,
  required this.onChanged,
  this.controller,
  this.itemsScrollController,
  this.initialItem,
  this.hintText,
  this.decoration,
  this.validator,
  this.validateOnChange = true,
  this.visibility,
  this.overlayController,
  this.listItemBuilder,
  this.headerBuilder,
  this.hintBuilder,
  this.maxlines = 1,
  this.overlayHeight,
  this.closedHeaderPadding,
  this.expandedHeaderPadding,
  this.itemsListPadding,
  this.listItemPadding,
  this.canCloseOutsideBounds = true,
  this.hideSelectedFieldWhenExpanded = false,
  this.excludeSelected = true,
  this.enabled = true,
  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,
      noResultFoundBuilder = null,
      noResultFoundText = null,
      searchHintText = null,
      initialItems = null,
      onListChanged = null,
      listValidator = null,
      headerListBuilder = null,
      searchRequestLoadingIndicator = null,
      closeDropDownOnClearFilterSearch = false,
      multiSelectController = null;