HcDropdownSearch<T> constructor
HcDropdownSearch<T> ({
- Key? key,
- FormFieldSetter<
T> ? onSaved, - FormFieldValidator<
T> ? validator, - AutovalidateMode? autoValidateMode = AutovalidateMode.disabled,
- ValueChanged<
T?> ? onChanged, - List<
T> items = const [], - T? selectedItem,
- HcDropdownSearchOnFind<
T> ? asyncItems, - HcDropdownSearchBuilder<
T> ? dropdownBuilder, - HcDropDownDecoratorProps dropdownDecoratorProps = const HcDropDownDecoratorProps(),
- HcClearButtonProps clearButtonProps = const HcClearButtonProps(),
- HcDropdownButtonProps dropdownButtonProps = const HcDropdownButtonProps(),
- bool enabled = true,
- HcDropdownSearchFilterFunction<
T> ? filterFn, - HcDropdownSearchItemAsString<
T> ? itemAsString, - HcDropdownSearchCompareFunction<
T> ? compareFn, - BeforeChange<
T> ? onBeforeChange, - BeforePopupOpening<
T> ? onBeforePopupOpening, - PopupProps<
T> popupProps = const PopupProps.menu(),
Implementation
HcDropdownSearch({
Key? key,
this.onSaved,
this.validator,
this.autoValidateMode = AutovalidateMode.disabled,
this.onChanged,
this.items = const [],
this.selectedItem,
this.asyncItems,
this.dropdownBuilder,
this.dropdownDecoratorProps = const HcDropDownDecoratorProps(),
this.clearButtonProps = const HcClearButtonProps(),
this.dropdownButtonProps = const HcDropdownButtonProps(),
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,
),
popupProps = HcPopupPropsMultiSelection.from(popupProps),
isMultiSelectionMode = false,
dropdownBuilderMultiSelection = null,
validatorMultiSelection = null,
onBeforeChangeMultiSelection = null,
selectedItems = const [],
onSavedMultiSelection = null,
onChangedMultiSelection = null,
onBeforePopupOpeningMultiSelection = null,
super(key: key);