DDSDropdown constructor

const DDSDropdown({
  1. Key? key,
  2. required List<Map<String, dynamic>> options,
  3. String placeholder = '',
  4. String label = '',
  5. TextStyle? labelTextStyle,
  6. dynamic values,
  7. double? optionsDropdownWidth = 200,
  8. required dynamic onSelect(
    1. dynamic
    ),
  9. Border? border,
  10. BorderRadius? borderRadius,
  11. EdgeInsets? padding,
  12. double? width = 300,
  13. double dropdownOptionsOffset = 10,
  14. double? height,
  15. double? dropdownMaxHeight,
  16. double? chipWidth,
  17. double? chipHeight,
  18. Color? chipBackgroundColor,
  19. Color? chipBorderColor,
  20. Color chipTextColor = Colors.white,
  21. Color? chipCloseIconColor = Colors.white,
  22. double? chipCloseIconSize = 18.0,
  23. Color? arrowIconColor,
  24. bool enableArrowRotation = true,
  25. Icon? dropdownArrowIcon,
  26. bool isMultiSelect = false,
  27. bool isSearchable = false,
  28. bool required = false,
  29. bool showChips = true,
  30. int? maxSelectableItems,
  31. Icon? selectIcon,
  32. Widget? emptyState,
  33. String? errorMessage = 'This field is required',
  34. TextStyle? errorMessageTextStyle,
  35. Color? dropdownBackgroundColor = Colors.white,
  36. Color? dropdownOptionsTextColor = Colors.black,
  37. Color? selectedItemBackgroundColor,
  38. Color? placeholderTextColor = Colors.grey,
  39. TextStyle? placeholderTextStyle,
  40. Color? selectedTextColor = Colors.black,
  41. TextStyle? selectedTextStyle,
  42. Color? containerBackgroundColor = Colors.white,
  43. bool showSelectionBadge = true,
  44. Color? badgeBackgroundColor,
  45. Color? badgeTextColor = Colors.white,
  46. double? badgeSize = 24.0,
  47. TextStyle? badgeTextStyle,
  48. InputDecoration? searchInputDecoration = const InputDecoration(prefixIcon: Icon(Icons.search), border: OutlineInputBorder(), contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 12), filled: true, fillColor: Colors.white),
  49. double? dropdownCustomMaxWidth = 0.0,
  50. Color? searchCursorColor,
  51. Color? searchCursorErrorColor,
  52. double? searchCursorHeight,
  53. double searchCursorWidth = 2.0,
  54. Radius? searchCursorRadius,
  55. bool? searchCursorOpacityAnimates,
  56. bool? searchShowCursor,
  57. String? searchPlaceholder,
  58. TextStyle? searchPlaceholderStyle,
  59. TextStyle? searchInputTextStyle,
  60. TextEditingController? searchController,
  61. bool stickySearchField = true,
  62. double? searchFieldWidth,
  63. double? searchFieldHeight,
  64. EdgeInsets? searchFieldPadding,
  65. Color? checkboxCheckedColor,
  66. Color? checkboxUncheckedColor,
  67. Color? checkboxCheckedBorderColor,
  68. Color? checkboxUncheckedBorderColor,
  69. CheckboxSize? checkboxSize,
  70. CheckboxShape? checkboxShape,
  71. CheckboxVariant? checkboxVariant,
  72. Icon? checkboxIcon,
  73. Color? checkboxIconColor,
  74. double? checkboxIconSize,
  75. Border? checkboxBorder,
  76. bool? isOpen,
  77. VoidCallback? onDropdownToggle,
  78. VoidCallback? onDropdownOpen,
  79. VoidCallback? onDropdownClose,
  80. bool closeOnOutsideClick = true,
  81. TextStyle? optionLabelTextStyle,
  82. double? optionLabelFontSize,
  83. FontWeight? optionLabelFontWeight,
  84. Color? optionLabelColor,
  85. double? optionLabelLetterSpacing,
  86. double? optionLabelLineHeight,
  87. TextDecoration? optionLabelDecoration,
  88. Color? optionLabelDecorationColor,
  89. List<Shadow>? optionLabelShadows,
  90. FontStyle? optionLabelFontStyle,
  91. TextAlign? optionLabelTextAlign,
  92. int? optionLabelMaxLines,
  93. TextOverflow? optionLabelOverflow,
  94. TextStyle? selectedOptionLabelTextStyle,
  95. double? selectedOptionLabelFontSize,
  96. FontWeight? selectedOptionLabelFontWeight,
  97. Color? selectedOptionLabelColor,
  98. double? selectedOptionLabelLetterSpacing,
  99. double? selectedOptionLabelLineHeight,
  100. TextDecoration? selectedOptionLabelDecoration,
  101. Color? selectedOptionLabelDecorationColor,
  102. List<Shadow>? selectedOptionLabelShadows,
  103. FontStyle? selectedOptionLabelFontStyle,
  104. TextAlign? selectedOptionLabelTextAlign,
  105. int? selectedOptionLabelMaxLines,
  106. TextOverflow? selectedOptionLabelOverflow,
  107. Border? dropdownBorder,
  108. Color? dropdownBorderColor,
  109. double? dropdownBorderWidth = 1.0,
  110. BorderRadius? dropdownBorderRadius,
  111. List<BoxShadow>? dropdownBoxShadow,
  112. bool enableSearchCustomSelection = false,
  113. Widget? searchCustomSelectionHandleWidget,
  114. Color? searchSelectionHandleColor,
  115. Color? searchTextSelectionColor,
  116. bool searchAutofocus = false,
  117. TextInputAction? searchTextInputAction,
  118. ValueChanged<String>? searchOnSubmitted,
})

Implementation

const DDSDropdown({
  Key? key,
  required this.options,
  this.placeholder = '',
  this.label = '',
  this.labelTextStyle,
  this.values,
  this.optionsDropdownWidth = 200,
  required this.onSelect,
  this.border,
  this.borderRadius,
  this.padding,
  this.width = 300,
  this.dropdownOptionsOffset = 10,
  this.height,
  this.dropdownMaxHeight,
  this.chipWidth,
  this.chipHeight,
  this.chipBackgroundColor,
  this.chipBorderColor,
  this.chipTextColor = Colors.white,
  this.chipCloseIconColor = Colors.white,
  this.chipCloseIconSize = 18.0,
  this.arrowIconColor,
  this.enableArrowRotation = true,
  this.dropdownArrowIcon,
  this.isMultiSelect = false,
  this.isSearchable = false,
  this.required = false,
  this.showChips = true,
  this.maxSelectableItems,
  this.selectIcon,
  this.emptyState,
  this.errorMessage = 'This field is required',
  this.errorMessageTextStyle,
  this.dropdownBackgroundColor = Colors.white,
  this.dropdownOptionsTextColor = Colors.black,
  this.selectedItemBackgroundColor,
  this.placeholderTextColor = Colors.grey,
  this.placeholderTextStyle,
  this.selectedTextColor = Colors.black,
  this.selectedTextStyle,
  this.containerBackgroundColor = Colors.white,
  this.showSelectionBadge = true,
  this.badgeBackgroundColor,
  this.badgeTextColor = Colors.white,
  this.badgeSize = 24.0,
  this.badgeTextStyle,
  this.searchInputDecoration = const InputDecoration(
    prefixIcon: Icon(Icons.search),
    border: OutlineInputBorder(),
    contentPadding: EdgeInsets.symmetric(vertical: 8, horizontal: 12),
    filled: true,
    fillColor: Colors.white,
  ),
  this.dropdownCustomMaxWidth = 0.0,
  this.searchCursorColor,
  this.searchCursorErrorColor,
  this.searchCursorHeight,
  this.searchCursorWidth = 2.0,
  this.searchCursorRadius,
  this.searchCursorOpacityAnimates,
  this.searchShowCursor,
  this.searchPlaceholder,
  this.searchPlaceholderStyle,
  this.searchInputTextStyle,
  this.searchController,
  this.stickySearchField = true,
  this.searchFieldWidth,
  this.searchFieldHeight,
  this.searchFieldPadding,
  this.checkboxCheckedColor,
  this.checkboxUncheckedColor,
  this.checkboxCheckedBorderColor,
  this.checkboxUncheckedBorderColor,
  this.checkboxSize,
  this.checkboxShape,
  this.checkboxVariant,
  this.checkboxIcon,
  this.checkboxIconColor,
  this.checkboxIconSize,
  this.checkboxBorder,
  this.isOpen,
  this.onDropdownToggle,
  this.onDropdownOpen,
  this.onDropdownClose,
  this.closeOnOutsideClick = true,
  this.optionLabelTextStyle,
  this.optionLabelFontSize,
  this.optionLabelFontWeight,
  this.optionLabelColor,
  this.optionLabelLetterSpacing,
  this.optionLabelLineHeight,
  this.optionLabelDecoration,
  this.optionLabelDecorationColor,
  this.optionLabelShadows,
  this.optionLabelFontStyle,
  this.optionLabelTextAlign,
  this.optionLabelMaxLines,
  this.optionLabelOverflow,
  this.selectedOptionLabelTextStyle,
  this.selectedOptionLabelFontSize,
  this.selectedOptionLabelFontWeight,
  this.selectedOptionLabelColor,
  this.selectedOptionLabelLetterSpacing,
  this.selectedOptionLabelLineHeight,
  this.selectedOptionLabelDecoration,
  this.selectedOptionLabelDecorationColor,
  this.selectedOptionLabelShadows,
  this.selectedOptionLabelFontStyle,
  this.selectedOptionLabelTextAlign,
  this.selectedOptionLabelMaxLines,
  this.selectedOptionLabelOverflow,
  this.dropdownBorder,
  this.dropdownBorderColor,
  this.dropdownBorderWidth = 1.0,
  this.dropdownBorderRadius,
  this.dropdownBoxShadow,
  this.enableSearchCustomSelection = false,
  this.searchCustomSelectionHandleWidget,
  this.searchSelectionHandleColor,
  this.searchTextSelectionColor,
  this.searchAutofocus = false,
  this.searchTextInputAction,
  this.searchOnSubmitted,
}) : super(key: key);