CustomSearchBar constructor

const CustomSearchBar({
  1. Key? key,
  2. TextEditingController? controller,
  3. FocusNode? focusNode,
  4. void onChanged(
    1. String
    )?,
  5. void onSearch(
    1. String
    )?,
  6. void onSubmitted(
    1. String
    )?,
  7. VoidCallback? onTap,
  8. VoidCallback? onClear,
  9. void onFocusChanged(
    1. bool
    )?,
  10. VoidCallback? onVoiceSearch,
  11. SearchBarStyle style = SearchBarStyle.outlined,
  12. SearchBarAnimationType animationType = SearchBarAnimationType.fade,
  13. double? height,
  14. double? width,
  15. EdgeInsetsGeometry? padding,
  16. EdgeInsetsGeometry? contentPadding,
  17. EdgeInsetsGeometry? margin,
  18. double? borderRadius,
  19. double? borderWidth,
  20. double? iconPaddingLeft,
  21. double? iconPaddingRight,
  22. double? iconSpacing,
  23. Color? backgroundColor,
  24. Color? focusedBackgroundColor,
  25. Color? disabledBackgroundColor,
  26. Color? borderColor,
  27. Color? focusedBorderColor,
  28. Color? errorBorderColor,
  29. Color? textColor,
  30. Color? hintColor,
  31. Color? iconColor,
  32. Color? focusedIconColor,
  33. Color? disabledIconColor,
  34. Color? cursorColor,
  35. Color? shadowColor,
  36. Color? clearButtonColor,
  37. Color? clearButtonBackgroundColor,
  38. Color? loadingIndicatorColor,
  39. Widget? prefixIcon,
  40. Widget? suffixIcon,
  41. IconData? prefixIconData,
  42. IconData? suffixIconData,
  43. double? prefixIconSize,
  44. double? suffixIconSize,
  45. bool showPrefixIcon = true,
  46. bool showClearButton = true,
  47. bool showVoiceButton = false,
  48. Widget? clearIcon,
  49. Widget? voiceIcon,
  50. double? clearIconSize,
  51. IconData? voiceIconData,
  52. String? hintText,
  53. TextStyle? textStyle,
  54. TextStyle? hintStyle,
  55. double? fontSize,
  56. FontWeight? fontWeight,
  57. String? fontFamily,
  58. int? maxLength,
  59. TextInputType? keyboardType,
  60. TextInputAction? textInputAction,
  61. TextCapitalization? textCapitalization,
  62. bool autofocus = false,
  63. bool readOnly = false,
  64. bool enabled = true,
  65. bool enableSuggestions = true,
  66. bool autocorrect = true,
  67. int? debounceMs,
  68. bool hapticFeedback = true,
  69. bool closeKeyboardOnSubmit = true,
  70. bool clearOnSubmit = false,
  71. bool selectAllOnFocus = false,
  72. bool isLoading = false,
  73. bool hasError = false,
  74. String? errorText,
  75. TextStyle? errorTextStyle,
  76. EdgeInsetsGeometry? errorTextPadding,
  77. Duration? animationDuration,
  78. Curve? animationCurve,
  79. double? elevation,
  80. double? focusedElevation,
  81. Widget? loadingWidget,
  82. double? loadingIndicatorSize,
  83. double? loadingIndicatorStrokeWidth,
  84. double? clearButtonPadding,
  85. BoxShape? clearButtonShape,
  86. List<TextInputFormatter>? inputFormatters,
  87. Iterable<String>? autofillHints,
  88. String? semanticLabel,
  89. bool? enableSecurity,
})

Implementation

const CustomSearchBar({
  super.key,
  // ============== Controllers & Focus ==============
  this.controller,
  this.focusNode,
  // ============== Callbacks ==============
  this.onChanged,
  this.onSearch,
  this.onSubmitted,
  this.onTap,
  this.onClear,
  this.onFocusChanged,
  this.onVoiceSearch,
  // ============== Style Configuration ==============
  this.style = SearchBarStyle.outlined,
  this.animationType = SearchBarAnimationType.fade,
  // ============== Size Configuration ==============
  this.height,
  this.width,
  this.padding,
  this.contentPadding,
  this.margin,
  this.borderRadius,
  this.borderWidth,
  this.iconPaddingLeft,
  this.iconPaddingRight,
  this.iconSpacing,
  // ============== Color Configuration ==============
  this.backgroundColor,
  this.focusedBackgroundColor,
  this.disabledBackgroundColor,
  this.borderColor,
  this.focusedBorderColor,
  this.errorBorderColor,
  this.textColor,
  this.hintColor,
  this.iconColor,
  this.focusedIconColor,
  this.disabledIconColor,
  this.cursorColor,
  this.shadowColor,
  this.clearButtonColor,
  this.clearButtonBackgroundColor,
  this.loadingIndicatorColor,
  // ============== Icon Configuration ==============
  this.prefixIcon,
  this.suffixIcon,
  this.prefixIconData,
  this.suffixIconData,
  this.prefixIconSize,
  this.suffixIconSize,
  this.showPrefixIcon = true,
  this.showClearButton = true,
  this.showVoiceButton = false,
  this.clearIcon,
  this.voiceIcon,
  this.clearIconSize,
  this.voiceIconData,
  // ============== Text Configuration ==============
  this.hintText,
  this.textStyle,
  this.hintStyle,
  this.fontSize,
  this.fontWeight,
  this.fontFamily,
  this.maxLength,
  // ============== Keyboard Configuration ==============
  this.keyboardType,
  this.textInputAction,
  this.textCapitalization,
  this.autofocus = false,
  this.readOnly = false,
  this.enabled = true,
  this.enableSuggestions = true,
  this.autocorrect = true,
  // ============== Behavior Configuration ==============
  this.debounceMs,
  this.hapticFeedback = true,
  this.closeKeyboardOnSubmit = true,
  this.clearOnSubmit = false,
  this.selectAllOnFocus = false,
  // ============== State Configuration ==============
  this.isLoading = false,
  this.hasError = false,
  this.errorText,
  this.errorTextStyle,
  this.errorTextPadding,
  // ============== Animation Configuration ==============
  this.animationDuration,
  this.animationCurve,
  this.elevation,
  this.focusedElevation,
  // ============== Loading Configuration ==============
  this.loadingWidget,
  this.loadingIndicatorSize,
  this.loadingIndicatorStrokeWidth,
  // ============== Clear Button Configuration ==============
  this.clearButtonPadding,
  this.clearButtonShape,
  // ============== Input Configuration ==============
  this.inputFormatters,
  this.autofillHints,
  // ============== Accessibility ==============
  this.semanticLabel,
  // ============== Security ==============
  this.enableSecurity,
});