DropdownSearch<T> constructor
DropdownSearch<T> ({
- Key? key,
- FormFieldSetter<
T> ? onSaved, - FormFieldValidator<
T> ? validator, - AutovalidateMode? autoValidateMode = AutovalidateMode.disabled,
- ValueChanged<
T?> ? onChanged, - List<
T> items = const [], - T? selectedItem,
- DropdownSearchOnFind<
T> ? asyncItems, - DropdownSearchBuilder<
T> ? dropdownBuilder, - DropDownDecoratorProps dropdownDecoratorProps = const DropDownDecoratorProps(),
- ClearButtonProps clearButtonProps = const ClearButtonProps(),
- DropdownButtonProps dropdownButtonProps = const DropdownButtonProps(),
- bool enabled = true,
- DropdownSearchFilterFn<
T> ? filterFn, - DropdownSearchItemAsString<
T> ? itemAsString, - DropdownSearchCompareFn<
T> ? compareFn, - BeforeChange<
T> ? onBeforeChange, - BeforePopupOpening<
T> ? onBeforePopupOpening, - PopupProps<
T> popupProps = const PopupProps.menu(),
Implementation
DropdownSearch({
Key? key,
this.onSaved,
this.validator,
this.autoValidateMode = AutovalidateMode.disabled,
this.onChanged,
this.items = const [],
this.selectedItem,
this.asyncItems,
this.dropdownBuilder,
this.dropdownDecoratorProps = const DropDownDecoratorProps(),
this.clearButtonProps = const ClearButtonProps(),
this.dropdownButtonProps = const DropdownButtonProps(),
this.enabled = true,
this.filterFn,
this.itemAsString,
this.compareFn,
this.onBeforeChange,
this.onBeforePopupOpening,
PopupProps<T> popupProps = const PopupProps.menu(),
}) : assert(
!popupProps.showSelectedItems || T == String || compareFn != null,
),
this.popupProps = PopupPropsMultiSelection.from(popupProps),
this.isMultiSelectionMode = false,
this.dropdownBuilderMultiSelection = null,
this.validatorMultiSelection = null,
this.onBeforeChangeMultiSelection = null,
this.selectedItems = const [],
this.onSavedMultiSelection = null,
this.onChangedMultiSelection = null,
this.onBeforePopupOpeningMultiSelection = null,
super(key: key);