StandardSearchBar constructor

const StandardSearchBar({
  1. Key? key,
  2. double? width,
  3. double height = 50,
  4. double borderRadius = 25,
  5. Color backgroundColor = Colors.white,
  6. String hintText = 'Search',
  7. TextStyle hintStyle = const TextStyle(color: Colors.grey),
  8. IconData startIcon = Icons.search,
  9. Color startIconColor = Colors.grey,
  10. IconData endIcon = Icons.mic,
  11. Color endIconColor = Colors.grey,
  12. bool showStartIcon = true,
  13. bool showEndIcon = false,
  14. Color cursorColor = Colors.grey,
  15. Color? startIconSplashColor,
  16. dynamic startIconOnTap()?,
  17. dynamic endIconOnTap()?,
  18. Color? endIconSplashColor,
  19. double startIconSize = 20,
  20. double endIconSize = 20,
  21. double horizontalPadding = 10,
  22. double startIconPaddingRight = 8,
  23. double endIconPaddingLeft = 8,
  24. dynamic onSubmitted(
    1. String
    )?,
  25. dynamic onChanged(
    1. String
    )?,
  26. List<BoxShadow> shadow = const [BoxShadow(color: Colors.black12, spreadRadius: 0, blurRadius: 5, offset: Offset(0, 3))],
  27. TextStyle textStyle = const TextStyle(color: Colors.black),
  28. List<String>? suggestions,
  29. double? suggestionsBoxHeight = 175,
  30. EdgeInsetsGeometry? suggestionsBoxPadding = const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
  31. TextStyle? suggestionTextStyle = const TextStyle(fontSize: 16),
  32. int? maxSuggestions = 10,
  33. Color? suggestionHoverColor,
  34. Color? suggestionHighlightColor,
  35. Decoration? suggestionDecoration,
})

Implementation

const StandardSearchBar({
  super.key,
  this.width,
  this.height = 50,
  this.borderRadius = 25,
  this.backgroundColor = Colors.white,
  this.hintText = 'Search',
  this.hintStyle = const TextStyle(color: Colors.grey),
  this.startIcon = Icons.search,
  this.startIconColor = Colors.grey,
  this.endIcon = Icons.mic,
  this.endIconColor = Colors.grey,
  this.showStartIcon = true,
  this.showEndIcon = false,
  this.cursorColor = Colors.grey,
  this.startIconSplashColor,
  this.startIconOnTap,
  this.endIconOnTap,
  this.endIconSplashColor,
  this.startIconSize = 20,
  this.endIconSize = 20,
  this.horizontalPadding = 10,
  this.startIconPaddingRight = 8,
  this.endIconPaddingLeft = 8,
  this.onSubmitted,
  this.onChanged,
  this.shadow = const [
    BoxShadow(
      color: Colors.black12,
      spreadRadius: 0,
      blurRadius: 5,
      offset: Offset(0, 3),
    ),
  ],
  this.textStyle = const TextStyle(color: Colors.black),
  this.suggestions,
  this.suggestionsBoxHeight = 175,
  this.suggestionsBoxPadding =
      const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
  this.suggestionTextStyle = const TextStyle(fontSize: 16),
  this.maxSuggestions = 10,
  this.suggestionHoverColor,
  this.suggestionHighlightColor,
  this.suggestionDecoration,
});