DropdownSearch<T> constructor
DropdownSearch<T> ({
- Key? key,
- FormFieldSetter<
T> ? onSaved, - FormFieldValidator<
T> ? validator, - AutovalidateMode? autoValidateMode = AutovalidateMode.disabled,
- ValueChanged<
T?> ? onChanged, - Mode mode = Mode.DIALOG,
- @Deprecated('Use labelText prop from dropdownSearchDecoration') String? label,
- @Deprecated('Use hintText prop from dropdownSearchDecoration') String? hint,
- bool isFilteredOnline = false,
- Widget? popupTitle,
- List<
T> ? items, - T? selectedItem,
- DropdownSearchOnFind<
T> ? onFind, - DropdownSearchBuilder<
T> ? dropdownBuilder, - DropdownSearchPopupItemBuilder<
T> ? popupItemBuilder, - bool showSearchBox = false,
- bool showClearButton = false,
- Color? popupBackgroundColor,
- bool enabled = true,
- double? maxHeight,
- DropdownSearchFilterFn<
T> ? filterFn, - DropdownSearchItemAsString<
T> ? itemAsString, - bool showSelectedItems = false,
- DropdownSearchCompareFn<
T> ? compareFn, - InputDecoration? dropdownSearchDecoration,
- EmptyBuilder? emptyBuilder,
- LoadingBuilder? loadingBuilder,
- ErrorBuilder? errorBuilder,
- double? dialogMaxWidth,
- Widget? clearButton,
- IconButtonBuilder? clearButtonBuilder,
- double? clearButtonSplashRadius,
- Widget? dropDownButton,
- IconButtonBuilder? dropdownButtonBuilder,
- double? dropdownButtonSplashRadius,
- bool showAsSuffixIcons = false,
- bool dropdownBuilderSupportsNullItem = false,
- ShapeBorder? popupShape,
- DropdownSearchPopupItemEnabled<
T> ? popupItemDisabled, - Color? popupBarrierColor,
- VoidCallback? onPopupDismissed,
- Duration? searchDelay,
- BeforeChange<
T> ? onBeforeChange, - FavoriteItemsBuilder<
T> ? favoriteItemBuilder, - FavoriteItems<
T> ? favoriteItems, - bool showFavoriteItems = false,
- MainAxisAlignment? favoriteItemsAlignment = MainAxisAlignment.start,
- PopupSafeArea popupSafeArea = const PopupSafeArea(),
- TextFieldProps? searchFieldProps,
- ScrollbarProps? scrollbarProps,
- bool popupBarrierDismissible = true,
- TextStyle? dropdownSearchBaseStyle,
- TextAlign? dropdownSearchTextAlign,
- TextAlignVertical? dropdownSearchTextAlignVertical,
- double popupElevation = 8,
- SelectionListViewProps selectionListViewProps = const SelectionListViewProps(),
- FocusNode? focusNode,
- PositionCallback? positionCallback,
Implementation
DropdownSearch({
Key? key,
this.onSaved,
this.validator,
this.autoValidateMode = AutovalidateMode.disabled,
this.onChanged,
this.mode = Mode.DIALOG,
@Deprecated('Use labelText prop from dropdownSearchDecoration') this.label,
@Deprecated('Use hintText prop from dropdownSearchDecoration') this.hint,
this.isFilteredOnline = false,
this.popupTitle,
this.items,
this.selectedItem,
this.onFind,
this.dropdownBuilder,
this.popupItemBuilder,
this.showSearchBox = false,
this.showClearButton = false,
this.popupBackgroundColor,
this.enabled = true,
this.maxHeight,
this.filterFn,
this.itemAsString,
this.showSelectedItems = false,
this.compareFn,
this.dropdownSearchDecoration,
this.emptyBuilder,
this.loadingBuilder,
this.errorBuilder,
this.dialogMaxWidth,
this.clearButton,
this.clearButtonBuilder,
this.clearButtonSplashRadius,
this.dropDownButton,
this.dropdownButtonBuilder,
this.dropdownButtonSplashRadius,
this.showAsSuffixIcons = false,
this.dropdownBuilderSupportsNullItem = false,
this.popupShape,
this.popupItemDisabled,
this.popupBarrierColor,
this.onPopupDismissed,
this.searchDelay,
this.onBeforeChange,
this.favoriteItemBuilder,
this.favoriteItems,
this.showFavoriteItems = false,
this.favoriteItemsAlignment = MainAxisAlignment.start,
this.popupSafeArea = const PopupSafeArea(),
TextFieldProps? searchFieldProps,
this.scrollbarProps,
this.popupBarrierDismissible = true,
this.dropdownSearchBaseStyle,
this.dropdownSearchTextAlign,
this.dropdownSearchTextAlignVertical,
this.popupElevation = 8,
this.selectionListViewProps = const SelectionListViewProps(),
this.focusNode,
this.positionCallback,
}) : assert(!showSelectedItems || T == String || compareFn != null),
this.searchFieldProps = searchFieldProps ?? TextFieldProps(),
this.isMultiSelectionMode = false,
this.dropdownBuilderMultiSelection = null,
this.validatorMultiSelection = null,
this.onBeforeChangeMultiSelection = null,
this.selectedItems = const [],
this.onSavedMultiSelection = null,
this.onChangedMultiSelection = null,
this.popupOnItemAdded = null,
this.popupOnItemRemoved = null,
this.popupSelectionWidget = null,
this.popupValidationMultiSelectionWidget = null,
super(key: key);