DDSSearch constructor
DDSSearch({
- Key? key,
- SearchShape shape = SearchShape.rounded,
- SearchShape floatingSearchBarOpenShape = SearchShape.rectangle,
- SearchShape floatingSearchBarCloseShape = SearchShape.rounded,
- SearchVariant variant = SearchVariant.floating,
- Color? startIconBackgroundColor = Colors.transparent,
- Widget? floatingButtonCollapsedIcon,
- required List<
Map< items,String, String> > - String initialFilter = 'All',
- dynamic onSearch()?,
- dynamic onItemSelected()?,
- Widget? endIcon,
- bool isExpanded = false,
- dynamic onSearchToggle()?,
- dynamic onIconClick()?,
- String placeholder = 'placeholder',
- required List<
String> filters, - Color backgroundColor = Colors.white,
- Color? searchBarColor = Colors.white,
- bool showStartIcon = false,
- InputDecoration? inputDecoration,
- Color iconColor = Colors.white,
- TextStyle hintStyle = const TextStyle(color: Colors.grey),
- double? height = 50,
- double? width = 358,
- BorderRadius? borderRadius,
- void onExpandedChanged()?,
- Widget? startIcon,
- bool autofocus = false,
- EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
- TextStyle? dropdownItemTextStyle,
- TextStyle? dropdownSelectedItemTextStyle,
- Color? dropdownMenuBackgroundColor,
- Color? filterMenuBackgroundColor,
- double? filterMenuWidth,
- TextStyle? searchResultTitleStyle,
- double? dropdownMaxHeight = 200,
- double? startIconWidth = 52,
- TextStyle? searchResultSubtitleStyle,
- Color borderColor = Colors.grey,
- Color dropdownBorderColor = Colors.grey,
- dynamic onStartIconTap()?,
- dynamic onEndIconTap()?,
- dynamic onCollapsedIconTap()?,
- BorderRadius? floatingBorderRadius,
- TextStyle? inputTextStyle,
- SearchBarOpenDirection openDirection = SearchBarOpenDirection.leftToRight,
- double cursorWidth = 2.0,
- double? cursorHeight,
- Radius? cursorRadius,
- bool? cursorOpacityAnimates,
- Color? cursorColor,
- Color? cursorErrorColor,
- bool? showCursor,
- Color? collapsedIconBorderColor,
- bool enableCustomSelection = false,
- Widget? customSelectionHandleWidget,
- Color? selectionHandleColor,
- Color? textSelectionColor,
- TextEditingController? controller,
- TextInputAction? textInputAction,
- ValueChanged<
String> ? onSubmitted,
Implementation
DDSSearch({
Key? key,
this.shape = SearchShape.rounded,
this.floatingSearchBarOpenShape = SearchShape.rectangle,
this.floatingSearchBarCloseShape = SearchShape.rounded,
this.variant = SearchVariant.floating,
this.startIconBackgroundColor = Colors.transparent,
this.floatingButtonCollapsedIcon,
required this.items,
this.initialFilter = 'All',
this.onSearch,
this.onItemSelected,
this.endIcon,
this.isExpanded = false,
this.onSearchToggle,
this.onIconClick,
this.placeholder = 'placeholder',
required this.filters,
this.backgroundColor = Colors.white,
this.searchBarColor = Colors.white,
this.showStartIcon = false,
this.inputDecoration,
this.iconColor = Colors.white,
this.hintStyle = const TextStyle(color: Colors.grey),
this.height = 50,
this.width = 358,
this.borderRadius,
this.onExpandedChanged,
this.startIcon,
this.autofocus = false,
this.padding = const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
this.dropdownItemTextStyle,
this.dropdownSelectedItemTextStyle,
this.dropdownMenuBackgroundColor,
this.filterMenuBackgroundColor,
this.filterMenuWidth,
this.searchResultTitleStyle,
this.dropdownMaxHeight = 200,
this.startIconWidth = 52,
this.searchResultSubtitleStyle,
this.borderColor = Colors.grey,
this.dropdownBorderColor = Colors.grey,
this.onStartIconTap,
this.onEndIconTap,
this.onCollapsedIconTap,
this.floatingBorderRadius,
this.inputTextStyle,
this.openDirection = SearchBarOpenDirection.leftToRight,
this.cursorWidth = 2.0,
this.cursorHeight,
this.cursorRadius,
this.cursorOpacityAnimates,
this.cursorColor,
this.cursorErrorColor,
this.showCursor,
this.collapsedIconBorderColor,
this.enableCustomSelection = false,
this.customSelectionHandleWidget,
this.selectionHandleColor,
this.textSelectionColor,
this.controller,
this.textInputAction,
this.onSubmitted,
}) : super(key: key);