OutlineSearchBar class
A widget that implements an outline search bar.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OutlineSearchBar
Constructors
-
OutlineSearchBar({Key? key, TextEditingController? textEditingController, TextInputType keyboardType = TextInputType.text, TextInputAction textInputAction = TextInputAction.search, double? maxHeight, Icon? icon, Color? backgroundColor, Color? borderColor, double borderWidth = 1.0, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4.0)), EdgeInsetsGeometry margin = const EdgeInsets.only(), EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 5.0), EdgeInsetsGeometry textPadding = const EdgeInsets.symmetric(horizontal: 5.0), double elevation = 0.0, String? initText, String? hintText, TextStyle? textStyle, TextStyle? hintStyle, int? maxLength, Color? cursorColor, double cursorWidth = 2.0, double? cursorHeight, Radius? cursorRadius, Color clearButtonColor = const Color(0xFFDDDDDD), Color clearButtonIconColor = const Color(0xFFFEFEFE), Color? searchButtonSplashColor, Color? searchButtonIconColor, SearchButtonPosition searchButtonPosition = SearchButtonPosition.trailing, int debounceDelay = 500, bool autoCorrect = false, bool enableSuggestions = true, bool hideSearchButton = false, bool ignoreWhiteSpace = false, bool ignoreSpecialChar = false, GestureTapCallback? onTap, ValueChanged<
String> ? onKeywordChanged, ValueChanged<String> ? onTypingFinished, ValueChanged<String> ? onClearButtonPressed, ValueChanged<String> ? onSearchButtonPressed, FocusNode? focusNode}) -
const
Properties
- autoCorrect → bool
-
Whether to use autoCorrect option.
Default value is
false
.final - backgroundColor → Color?
-
Set the color of OutlineSearchBar.
Default value is
Theme.of(context).scaffoldBackgroundColor
.final - borderColor → Color?
-
Set the border color of OutlineSearchBar.
If value is null and theme brightness is light, use primaryColor, if dark, use accentColor.
final
- borderRadius → BorderRadius
-
Set the border radius of OutlineSearchBar.
Default value is
const BorderRadius.all(const Radius.circular(4.0))
.final - borderWidth → double
-
Set the border thickness of OutlineSearchBar.
Default value is
1.0
.final - clearButtonColor → Color
-
Set the background color of the clear button.
Default value is
const Color(0xFFDDDDDD)
.final - clearButtonIconColor → Color
-
Set the icon color inside the clear button.
Default value is
const Color(0xFFFEFEFE)
.final - cursorColor → Color?
-
Set the color of cursor.
final
- cursorHeight → double?
-
Set the height of cursor.
final
- cursorRadius → Radius?
-
Set the radius of cursor.
final
- cursorWidth → double
-
Set the width of cursor.
Default value is
2.0
.final - debounceDelay → int
-
The delay between when the user stops typing a keyword and receives the onTypingFinished event.
Default value is
500
.final - elevation → double
-
Set the elevation of OutlineSearchBar.
Default value is
0.0
.final - enableSuggestions → bool
-
Whether to use enableSuggestions option.
Default value is
true
.final - focusNode → FocusNode?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hideSearchButton → bool
-
Whether to hide the search button.
Default value is
false
.final - hintStyle → TextStyle?
-
Set the style of hintText.
final
- hintText → String?
-
Set the text to be displayed when the keyword is empty.
final
- icon → Icon?
-
Set the icon of OutlineSearchBar.
final
- ignoreSpecialChar → bool
-
Whether to ignore input of special characters.
Default value is
false
.final - ignoreWhiteSpace → bool
-
Whether to ignore input of white space.
Default value is
false
.final - initText → String?
-
Set the keyword to be initially entered.
If initial text is set in textEditingController, this value is ignored.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardType → TextInputType
-
Set keyboard type.
Default value is TextInputType.text.
final
- margin → EdgeInsetsGeometry
-
Set the margin value of OutlineSearchBar.
Default value is
const EdgeInsets.only()
.final - maxHeight → double?
-
Set the maximum height of OutlineSearchBar.
final
- maxLength → int?
-
Set the maximum length of text to be entered.
final
-
onClearButtonPressed
→ ValueChanged<
String> ? -
When the clear button is pressed, it is called with the previous keyword.
final
-
onKeywordChanged
→ ValueChanged<
String> ? -
Called whenever a keyword is changed.
final
-
onSearchButtonPressed
→ ValueChanged<
String> ? -
When the search button is pressed, it is called with the entered keyword.
final
- onTap → GestureTapCallback?
-
Called when OutlineSearchBar is tapped.
final
-
onTypingFinished
→ ValueChanged<
String> ? -
Called when keyword typing is finished.
final
- padding → EdgeInsetsGeometry
-
Set the padding value of OutlineSearchBar.
Default value is
const EdgeInsets.symmetric(horizontal: 5.0)
.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchButtonIconColor → Color?
-
Set the icon color inside the search button.
If value is null and theme brightness is light, use primaryColor, if dark, use accentColor.
final
- searchButtonPosition → SearchButtonPosition
-
Set the position of the search button.
Default value is SearchButtonPosition.trailing.
final
- searchButtonSplashColor → Color?
-
Set the splash color that appears when the search button is pressed.
final
- textEditingController → TextEditingController?
-
The keyword of OutlineSearchBar can be controlled with a TextEditingController.
final
- textInputAction → TextInputAction
-
Set keyboard action.
Default value is TextInputAction.search.
final
- textPadding → EdgeInsetsGeometry
-
Set the text padding value of OutlineSearchBar.
Default value is
const EdgeInsets.symmetric(horizontal: 5.0)
.final - textStyle → TextStyle?
-
Set the input text style.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _OutlineSearchBarState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited