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. String? label,
  8. required TextStyle style,
  9. String? hint,
  10. bool isFilteredOnline = false,
  11. Widget? popupTitle,
  12. List<T>? items,
  13. T? selectedItem,
  14. DropdownSearchOnFind<T>? onFind,
  15. DropdownSearchBuilder<T>? dropdownBuilder,
  16. DropdownSearchPopupItemBuilder<T>? popupItemBuilder,
  17. bool showSearchBox = false,
  18. bool showClearButton = false,
  19. InputDecoration? searchBoxDecoration,
  20. Color? popupBackgroundColor,
  21. bool enabled = true,
  22. double? maxHeight,
  23. DropdownSearchFilterFn<T>? filterFn,
  24. DropdownSearchItemAsString<T>? itemAsString,
  25. bool showSelectedItem = false,
  26. DropdownSearchCompareFn<T>? compareFn,
  27. InputDecoration? dropdownSearchDecoration,
  28. EmptyBuilder? emptyBuilder,
  29. LoadingBuilder? loadingBuilder,
  30. ErrorBuilder? errorBuilder,
  31. bool autoFocusSearchBox = false,
  32. double? dialogMaxWidth,
  33. Widget? clearButton,
  34. IconButtonBuilder? clearButtonBuilder,
  35. double? clearButtonSplashRadius,
  36. Widget? dropDownButton,
  37. IconButtonBuilder? dropdownButtonBuilder,
  38. double? dropdownButtonSplashRadius,
  39. bool showAsSuffixIcons = false,
  40. bool dropdownBuilderSupportsNullItem = false,
  41. ShapeBorder? popupShape,
  42. DropdownSearchPopupItemEnabled<T>? popupItemDisabled,
  43. Color? popupBarrierColor,
  44. VoidCallback? onPopupDismissed,
  45. TextEditingController? searchBoxController,
  46. Duration? searchDelay,
  47. BeforeChange<T?>? onBeforeChange,
  48. FavoriteItemsBuilder<T>? favoriteItemBuilder,
  49. FavoriteItems<T>? favoriteItems,
  50. bool showFavoriteItems = false,
  51. MainAxisAlignment? favoriteItemsAlignment = MainAxisAlignment.start,
  52. TextStyle? searchBoxStyle,
  53. PopupSafeArea popupSafeArea = const PopupSafeArea(),
  54. TextFieldProps? searchFieldProps,
  55. ScrollbarProps? scrollbarProps,
  56. bool popupBarrierDismissible = true,
  57. TextStyle? dropdownSearchBaseStyle,
  58. TextAlign? dropdownSearchTextAlign,
  59. TextAlignVertical? dropdownSearchTextAlignVertical,
})

Implementation

DropdownSearch({
  Key? key,
  this.onSaved,
  this.validator,
  this.autoValidateMode = AutovalidateMode.disabled,
  this.onChanged,
  this.mode = Mode.DIALOG,
  this.label,
  required this.style,
  this.hint,
  this.isFilteredOnline = false,
  this.popupTitle,
  this.items,
  this.selectedItem,
  this.onFind,
  this.dropdownBuilder,
  this.popupItemBuilder,
  this.showSearchBox = false,
  this.showClearButton = false,
  this.searchBoxDecoration,
  this.popupBackgroundColor,
  this.enabled = true,
  this.maxHeight,
  this.filterFn,
  this.itemAsString,
  this.showSelectedItem = false,
  this.compareFn,
  this.dropdownSearchDecoration,
  this.emptyBuilder,
  this.loadingBuilder,
  this.errorBuilder,
  this.autoFocusSearchBox = false,
  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.searchBoxController,
  this.searchDelay,
  this.onBeforeChange,
  this.favoriteItemBuilder,
  this.favoriteItems,
  this.showFavoriteItems = false,
  this.favoriteItemsAlignment = MainAxisAlignment.start,
  this.searchBoxStyle,
  this.popupSafeArea = const PopupSafeArea(),
  this.searchFieldProps,
  this.scrollbarProps,
  this.popupBarrierDismissible = true,
  this.dropdownSearchBaseStyle,
  this.dropdownSearchTextAlign,
  this.dropdownSearchTextAlignVertical,
})  : assert(!showSelectedItem || T == String || compareFn != null),
      super(key: key);