DropdownSearch<T> constructor

DropdownSearch<T>({
  1. Key? key,
  2. FormFieldSetter<T>? onSaved,
  3. FormFieldValidator<T>? validator,
  4. AutovalidateMode? autoValidateMode = AutovalidateMode.disabled,
  5. ValueChanged<T?>? onChanged,
  6. Mode mode = Mode.DIALOG,
  7. @Deprecated('Use labelText prop from dropdownSearchDecoration') String? label,
  8. @Deprecated('Use hintText prop from dropdownSearchDecoration') String? hint,
  9. bool isFilteredOnline = false,
  10. Widget? popupTitle,
  11. List<T>? items,
  12. T? selectedItem,
  13. DropdownSearchOnFind<T>? onFind,
  14. DropdownSearchBuilder<T>? dropdownBuilder,
  15. DropdownSearchPopupItemBuilder<T>? popupItemBuilder,
  16. bool showSearchBox = false,
  17. bool showClearButton = false,
  18. Color? popupBackgroundColor,
  19. bool enabled = true,
  20. double? maxHeight,
  21. DropdownSearchFilterFn<T>? filterFn,
  22. DropdownSearchItemAsString<T>? itemAsString,
  23. bool showSelectedItems = false,
  24. DropdownSearchCompareFn<T>? compareFn,
  25. InputDecoration? dropdownSearchDecoration,
  26. EmptyBuilder? emptyBuilder,
  27. LoadingBuilder? loadingBuilder,
  28. ErrorBuilder? errorBuilder,
  29. double? dialogMaxWidth,
  30. Widget? clearButton,
  31. IconButtonBuilder? clearButtonBuilder,
  32. double? clearButtonSplashRadius,
  33. Widget? dropDownButton,
  34. IconButtonBuilder? dropdownButtonBuilder,
  35. double? dropdownButtonSplashRadius,
  36. bool showAsSuffixIcons = false,
  37. bool dropdownBuilderSupportsNullItem = false,
  38. ShapeBorder? popupShape,
  39. DropdownSearchPopupItemEnabled<T>? popupItemDisabled,
  40. Color? popupBarrierColor,
  41. VoidCallback? onPopupDismissed,
  42. Duration? searchDelay,
  43. BeforeChange<T>? onBeforeChange,
  44. FavoriteItemsBuilder<T>? favoriteItemBuilder,
  45. FavoriteItems<T>? favoriteItems,
  46. bool showFavoriteItems = false,
  47. MainAxisAlignment? favoriteItemsAlignment = MainAxisAlignment.start,
  48. PopupSafeArea popupSafeArea = const PopupSafeArea(),
  49. TextFieldProps? searchFieldProps,
  50. ScrollbarProps? scrollbarProps,
  51. bool popupBarrierDismissible = true,
  52. TextStyle? dropdownSearchBaseStyle,
  53. TextAlign? dropdownSearchTextAlign,
  54. TextAlignVertical? dropdownSearchTextAlignVertical,
  55. double popupElevation = 8,
  56. SelectionListViewProps selectionListViewProps = const SelectionListViewProps(),
  57. FocusNode? focusNode,
  58. 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);