StandardSearchBar constructor
const
StandardSearchBar({
- Key? key,
- double? width,
- double height = 50,
- double borderRadius = 25,
- Color backgroundColor = Colors.white,
- String hintText = 'Search',
- TextStyle hintStyle = const TextStyle(color: Colors.grey),
- IconData startIcon = Icons.search,
- Color startIconColor = Colors.grey,
- IconData endIcon = Icons.mic,
- Color endIconColor = Colors.grey,
- bool showStartIcon = true,
- bool showEndIcon = false,
- Color cursorColor = Colors.grey,
- Color? startIconSplashColor,
- dynamic startIconOnTap()?,
- dynamic endIconOnTap()?,
- Color? endIconSplashColor,
- double startIconSize = 20,
- double endIconSize = 20,
- double horizontalPadding = 10,
- double startIconPaddingRight = 8,
- double endIconPaddingLeft = 8,
- dynamic onSubmitted()?,
- dynamic onChanged()?,
- List<
BoxShadow> shadow = const [BoxShadow(color: Colors.black12, spreadRadius: 0, blurRadius: 5, offset: Offset(0, 3))], - TextStyle textStyle = const TextStyle(color: Colors.black),
- List<
String> ? suggestions, - double? suggestionsBoxHeight = 175,
- EdgeInsetsGeometry? suggestionsBoxPadding = const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
- TextStyle? suggestionTextStyle = const TextStyle(fontSize: 16),
- int? maxSuggestions = 10,
- Color? suggestionHoverColor,
- Color? suggestionHighlightColor,
- 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,
});