ShadSelect<T> constructor

const ShadSelect<T>({
  1. Key? key,
  2. required ShadSelectedOptionBuilder<T>? selectedOptionBuilder,
  3. Iterable<Widget>? options,
  4. Widget? optionsBuilder(
    1. BuildContext,
    2. int
    )?,
  5. ShadPopoverController? popoverController,
  6. bool enabled = true,
  7. Widget? placeholder,
  8. TextStyle? placeholderStyle,
  9. T? initialValue,
  10. ValueChanged<T?>? onChanged,
  11. FocusNode? focusNode,
  12. bool closeOnTapOutside = true,
  13. double? minWidth,
  14. double? maxWidth,
  15. double? maxHeight,
  16. ShadDecoration? decoration,
  17. Widget? trailing,
  18. EdgeInsetsGeometry? padding,
  19. EdgeInsetsGeometry? optionsPadding,
  20. bool? showScrollToBottomChevron,
  21. bool? showScrollToTopChevron,
  22. ScrollController? scrollController,
  23. ShadAnchorBase? anchor,
  24. List<Effect>? effects,
  25. List<BoxShadow>? shadows,
  26. ImageFilter? filter,
  27. Widget? header,
  28. Widget? footer,
  29. bool closeOnSelect = true,
  30. bool allowDeselection = false,
  31. Object? groupId,
  32. int? itemCount,
  33. bool? shrinkWrap,
  34. ShadSelectController<T>? controller,
  35. Duration? popoverReverseDuration,
  36. bool? ensureSelectedVisible,
  37. 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',
     );