SDropdown constructor
const
SDropdown({
- Key? key,
- required List<
String> items, - List<
String> customItemsNamesDisplayed = const [], - double? width,
- double? height,
- double? overlayHeight,
- double? overlayWidth,
- double? scale,
- String? selectedItem,
- String? initialItem,
- String? hintText,
- dynamic onChanged()?,
- TextStyle? itemTextStyle,
- TextStyle? headerTextStyle,
- TextStyle? hintTextStyle,
- Map<
String, TextStyle> ? itemSpecificStyles, - Color? closedFillColor,
- Color? expandedFillColor,
- Border? closedBorder,
- Border? expandedBorder,
- BorderRadius? closedBorderRadius,
- BorderRadius? expandedBorderRadius,
- EdgeInsets? closedHeaderPadding,
- EdgeInsets? expandedHeaderPadding,
- EdgeInsets? itemsListPadding,
- EdgeInsets? listItemPadding,
- ScrollController? itemsScrollController,
- bool excludeSelected = true,
- bool canCloseOutsideBounds = true,
- bool enabled = true,
- AlignmentGeometry? alignment,
- int maxLines = 1,
- Widget? suffixIcon,
- Widget? prefixIcon,
- String? validator()?,
- bool validateOnChange = true,
- SDropdownDecoration? decoration,
- Color? headerExpandedColor,
- String? selectedItemText,
- SDropdownController? controller,
- int? autoScrollMaxFrameDelay,
- int? autoScrollEndOfFrameDelay,
- FocusNode? focusNode,
- bool requestFocusOnInit = false,
Implementation
const SDropdown({
super.key,
required this.items,
this.customItemsNamesDisplayed = const [],
this.width,
this.height,
this.overlayHeight,
this.overlayWidth,
this.scale,
this.selectedItem,
this.initialItem,
this.hintText,
this.onChanged,
this.itemTextStyle,
this.headerTextStyle,
this.hintTextStyle,
this.itemSpecificStyles,
this.closedFillColor,
this.expandedFillColor,
this.closedBorder,
this.expandedBorder,
this.closedBorderRadius,
this.expandedBorderRadius,
this.closedHeaderPadding,
this.expandedHeaderPadding,
this.itemsListPadding,
this.listItemPadding,
this.itemsScrollController,
this.excludeSelected = true,
this.canCloseOutsideBounds = true,
this.enabled = true,
this.alignment,
this.maxLines = 1,
this.suffixIcon,
this.prefixIcon,
this.validator,
this.validateOnChange = true,
this.decoration,
this.headerExpandedColor,
this.selectedItemText,
this.controller,
this.autoScrollMaxFrameDelay,
this.autoScrollEndOfFrameDelay,
this.useKeyboardNavigation = true,
this.focusNode,
this.requestFocusOnInit = false,
}) : assert(
initialItem == null,
'Use selectedItem instead of initialItem',
);