SearchBar class
Constructors
SearchBar ({required SetStateCallback setState , required AppBarCallback buildDefaultAppBar , TextFieldSubmitCallback ? onSubmitted , TextEditingController ? controller , String hintText = 'Search' , bool inBar = true , bool closeOnSubmit = true , bool clearOnSubmit = true , bool showClearButton = true , TextFieldChangeCallback ? onChanged , VoidCallback ? onClosed , VoidCallback ? onCleared })
Properties
buildDefaultAppBar
→ AppBarCallback
A callback which should return an AppBar that is displayed until search is started. One of the actions in this AppBar should be a search button which you obtain from SearchBar.getSearchAction(). This will be called every time search is ended, etc. (like a build method on a widget)
final
clearOnSubmit
→ bool
Whether the text field should be cleared when it is submitted
final
closeOnSubmit
→ bool
Whether or not the search bar should close on submit. Defaults to true.
final
controller
↔ TextEditingController ?
The controller to be used in the textField.
getter/setter pair
hashCode
→ int
The hash code for this object.
no setter inherited
hintText
→ String
What the hintText on the search bar should be. Defaults to 'Search'.
final
inBar
→ bool
Whether the search should take place "in the existing search bar", meaning whether it has the same background or a flipped one. Defaults to true.
final
isSearching
→ ValueNotifier <bool >
Whether search is currently active.
final
onChanged
→ TextFieldChangeCallback ?
A callback which is invoked each time the text field's value changes
final
onCleared
→ VoidCallback ?
A callback which is fired when clear button is pressed.
final
onClosed
→ VoidCallback ?
A void callback which gets fired on close button press.
final
onSubmitted
→ TextFieldSubmitCallback ?
A void callback which takes a string as an argument, this is fired every time the search is submitted. Do what you want with the result.
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
setState
→ SetStateCallback
Since this should be inside of a State class, just pass setState to this.
final
showClearButton
→ bool
Whether or not the search bar should add a clear input button, defaults to true.
final