DDSSearch constructor

DDSSearch({
  1. Key? key,
  2. SearchShape shape = SearchShape.rounded,
  3. SearchShape floatingSearchBarOpenShape = SearchShape.rectangle,
  4. SearchShape floatingSearchBarCloseShape = SearchShape.rounded,
  5. SearchVariant variant = SearchVariant.floating,
  6. Color? startIconBackgroundColor = Colors.transparent,
  7. Widget? floatingButtonCollapsedIcon,
  8. required List<Map<String, String>> items,
  9. String initialFilter = 'All',
  10. dynamic onSearch(
    1. String query,
    2. String filter
    )?,
  11. dynamic onItemSelected(
    1. Map<String, String> item
    )?,
  12. Widget? endIcon,
  13. bool isExpanded = false,
  14. dynamic onSearchToggle()?,
  15. dynamic onIconClick()?,
  16. String placeholder = 'placeholder',
  17. required List<String> filters,
  18. Color backgroundColor = Colors.white,
  19. Color? searchBarColor = Colors.white,
  20. bool showStartIcon = false,
  21. InputDecoration? inputDecoration,
  22. Color iconColor = Colors.white,
  23. TextStyle hintStyle = const TextStyle(color: Colors.grey),
  24. double? height = 50,
  25. double? width = 358,
  26. BorderRadius? borderRadius,
  27. void onExpandedChanged(
    1. bool
    )?,
  28. Widget? startIcon,
  29. bool autofocus = false,
  30. EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
  31. TextStyle? dropdownItemTextStyle,
  32. TextStyle? dropdownSelectedItemTextStyle,
  33. Color? dropdownMenuBackgroundColor,
  34. Color? filterMenuBackgroundColor,
  35. double? filterMenuWidth,
  36. TextStyle? searchResultTitleStyle,
  37. double? dropdownMaxHeight = 200,
  38. double? startIconWidth = 52,
  39. TextStyle? searchResultSubtitleStyle,
  40. Color borderColor = Colors.grey,
  41. Color dropdownBorderColor = Colors.grey,
  42. dynamic onStartIconTap()?,
  43. dynamic onEndIconTap()?,
  44. dynamic onCollapsedIconTap()?,
  45. BorderRadius? floatingBorderRadius,
  46. TextStyle? inputTextStyle,
  47. SearchBarOpenDirection openDirection = SearchBarOpenDirection.leftToRight,
  48. double cursorWidth = 2.0,
  49. double? cursorHeight,
  50. Radius? cursorRadius,
  51. bool? cursorOpacityAnimates,
  52. Color? cursorColor,
  53. Color? cursorErrorColor,
  54. bool? showCursor,
  55. Color? collapsedIconBorderColor,
  56. bool enableCustomSelection = false,
  57. Widget? customSelectionHandleWidget,
  58. Color? selectionHandleColor,
  59. Color? textSelectionColor,
  60. TextEditingController? controller,
  61. TextInputAction? textInputAction,
  62. 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);