CustomDropdown<T>.searchRequest constructor
const
CustomDropdown<T>.searchRequest ({
- Key? key,
- Future<
List< futureRequest()?,T> > - required dynamic onChanged(
- T?
- PaginatedSearchRequest<
T> ? paginatedRequest, - int pageSize = 20,
- Widget? loadMoreIndicator,
- Duration? futureRequestDelay,
- int searchRequestMinChars = 0,
- T? initialItem,
- List<
T> ? items, - SingleSelectController<
T?> ? controller, - ScrollController? itemsScrollController,
- String? hintText,
- String? labelText,
- Widget? label,
- CustomDropdownDecoration? decoration,
- dynamic visibility()?,
- OverlayPortalController? overlayController,
- String? searchHintText,
- String? noResultFoundText,
- _ListItemBuilder<
T> ? listItemBuilder, - _HeaderBuilder<
T> ? headerBuilder, - _HintBuilder? hintBuilder,
- _NoResultFoundBuilder? noResultFoundBuilder,
- String? validator(
- T?
- bool validateOnChange = true,
- int maxlines = 1,
- TextAlign textAlign = TextAlign.start,
- double? overlayHeight,
- EdgeInsets? closedHeaderPadding,
- EdgeInsets? expandedHeaderPadding,
- EdgeInsets? itemsListPadding,
- EdgeInsets? listItemPadding,
- Widget? searchRequestLoadingIndicator,
- bool excludeSelected = true,
- bool canCloseOutsideBounds = true,
- bool hideSelectedFieldWhenExpanded = false,
- bool enabled = true,
- bool canClearSelection = false,
- bool selectOnItemTap = true,
- CustomDropdownAnimation animation = const CustomDropdownAnimation(),
- bool initiallyOpen = false,
- bool autofocusOnSearch = false,
- DropdownOverlayDirection overlayDirection = DropdownOverlayDirection.auto,
- CustomDropdownDisabledDecoration? disabledDecoration,
- bool closeDropDownOnClearFilterSearch = false,
Implementation
const CustomDropdown.searchRequest({
super.key,
this.futureRequest,
required this.onChanged,
this.paginatedRequest,
this.pageSize = 20,
this.loadMoreIndicator,
this.futureRequestDelay,
this.searchRequestMinChars = 0,
this.initialItem,
this.items,
this.controller,
this.itemsScrollController,
this.hintText,
this.labelText,
this.label,
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.textAlign = TextAlign.start,
this.overlayHeight,
this.closedHeaderPadding,
this.expandedHeaderPadding,
this.itemsListPadding,
this.listItemPadding,
this.searchRequestLoadingIndicator,
this.excludeSelected = true,
this.canCloseOutsideBounds = true,
this.hideSelectedFieldWhenExpanded = false,
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,
this.closeDropDownOnClearFilterSearch = false,
}) : assert(
initialItem == null || controller == null,
'Only one of initialItem or controller can be specified at a time',
),
assert(
(futureRequest == null) != (paginatedRequest == null),
'Provide exactly one of futureRequest or paginatedRequest',
),
_searchType = _SearchType.onRequestData,
_dropdownType = _DropdownType.singleSelect,
initialItems = null,
onListChanged = null,
listValidator = null,
headerListBuilder = null,
multiSelectController = null;