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