ShadSelect<T> constructor
const
ShadSelect<T> ({
- Key? key,
- required ShadSelectedOptionBuilder<
T> ? selectedOptionBuilder, - Iterable<
Widget> ? options, - Widget? optionsBuilder()?,
- ShadPopoverController? popoverController,
- bool enabled = true,
- Widget? placeholder,
- TextStyle? placeholderStyle,
- T? initialValue,
- ValueChanged<
T?> ? onChanged, - FocusNode? focusNode,
- bool closeOnTapOutside = true,
- double? minWidth,
- double? maxWidth,
- double? maxHeight,
- ShadDecoration? decoration,
- Widget? trailing,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? optionsPadding,
- bool? showScrollToBottomChevron,
- bool? showScrollToTopChevron,
- ScrollController? scrollController,
- ShadAnchorBase? anchor,
- List<
Effect> ? effects, - List<
BoxShadow> ? shadows, - ImageFilter? filter,
- Widget? header,
- bool closeOnSelect = true,
- bool allowDeselection = false,
- Object? groupId,
- int? itemCount,
- bool? shrinkWrap,
- ShadSelectController<
T> ? controller, - Duration? popoverReverseDuration,
- bool? ensureSelectedVisible,
- VoidCallback? onPressed,
Creates a ShadSelect with the primary variant.
Implementation
const ShadSelect({
super.key,
required this.selectedOptionBuilder,
this.options,
this.optionsBuilder,
this.popoverController,
this.enabled = true,
this.placeholder,
this.placeholderStyle,
this.initialValue,
this.onChanged,
this.focusNode,
this.closeOnTapOutside = true,
this.minWidth,
this.maxWidth,
this.maxHeight,
this.decoration,
this.trailing,
this.padding,
this.optionsPadding,
this.showScrollToBottomChevron,
this.showScrollToTopChevron,
this.scrollController,
this.anchor,
this.effects,
this.shadows,
this.filter,
this.header,
this.footer,
this.closeOnSelect = true,
this.allowDeselection = false,
this.groupId,
this.itemCount,
this.shrinkWrap,
this.controller,
this.popoverReverseDuration,
this.ensureSelectedVisible,
this.onPressed,
}) : variant = ShadSelectVariant.primary,
initialValues = const {},
onSearchChanged = null,
searchDivider = null,
searchPlaceholder = null,
searchInputLeading = null,
onMultipleChanged = null,
searchPadding = null,
selectedOptionsBuilder = null,
search = null,
clearSearchOnClose = false,
searchFocusNode = null,
onSearchSubmitted = null,
assert(
options != null || optionsBuilder != null,
'Either options or optionsBuilder must be provided',
);