DropdownFlutter<T> constructor
DropdownFlutter<T> ({
- Key? key,
- required List<
T> ? items, - required dynamic onChanged(
- T?
- SingleSelectController<
T?> ? controller, - ScrollController? itemsScrollController,
- T? initialItem,
- String? hintText,
- CustomDropdownDecoration? decoration,
- String? validator(
- T?
- bool validateOnChange = true,
- dynamic visibility()?,
- OverlayPortalController? overlayController,
- _ListItemBuilder<
T> ? listItemBuilder, - _HeaderBuilder<
T> ? headerBuilder, - _HintBuilder? hintBuilder,
- int maxlines = 1,
- double? overlayHeight,
- EdgeInsets? closedHeaderPadding,
- EdgeInsets? expandedHeaderPadding,
- EdgeInsets? itemsListPadding,
- EdgeInsets? listItemPadding,
- bool canCloseOutsideBounds = true,
- bool hideSelectedFieldWhenExpanded = false,
- bool excludeSelected = true,
- bool enabled = true,
- 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;