This package allows you to create an outlined Material design search bar.

Screenshots

Getting started

To use this package, add outline_search_bar as a dependency in your pubspec.yaml file. For example:

dependencies:
  outline_search_bar: ^1.0.3

OutlineSearchBar

ParameterDescription
textEditingControllerThe keyword of OutlineSearchBar can be controlled with a TextEditingController.
backgroundColorSet the color of OutlineSearchBar.
Default value is Color(0xFFFEFEFE).
borderColorSet the border color of OutlineSearchBar. If value is null and theme brightness is light, use primaryColor, if dark, use accentColor.
borderWidthSet the border thickness of OutlineSearchBar.
Default value is 1.0.
borderRadiusSet the border radius of OutlineSearchBar.
Default value is BorderRadius.all(Radius.circular(4.0)).
marginSet the margin value of OutlineSearchBar.
Default value is EdgeInsets.only().
textPaddingSet the text padding value of OutlineSearchBar.
Default value is EdgeInsets.only(left: 10.0).
elevationSet the elevation of OutlineSearchBar.
Default value is 0.0.
initTextSet the keyword to be initially entered. If initial text is set in textEditingController, this value is ignored.
hintTextSet the text to be displayed when the keyword is empty.
textStyleSet the input text style.
hintStyleSet the style of hintText.
maxLengthSet the maximum length of text to be entered.
cursorColorSet the color of cursor.
cursorWidthSet the width of cursor.
Default value is 2.0.
cursorHeightSet the height of cursor.
cursorRadiusSet the radius of cursor.
clearButtonColorSet the background color of the clear button.
Default value is Color(0xFFDDDDDD).
clearButtonIconColorSet the icon color inside the clear button.
Default value is Color(0xFFFEFEFE).
searchButtonSplashColorSet the splash color that appears when the search button is pressed.
searchButtonIconColorSet the icon color inside the search button. If value is null and theme brightness is light, use primaryColor, if dark, use accentColor.
autoCorrectWhether to use autoCorrect option.
Default value is false.
hideSearchButtonWhether to hide the search button.
Default value is false.
ignoreWhiteSpaceWhether to ignore input of white space.
Default value is false.
ignoreSpecialCharWhether to ignore input of special characters.
Default value is false.
onKeywordChangedCalled whenever a keyword is entered.
onSearchButtonPressedWhen you press the search button, it is called with the entered keyword.

Libraries