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