SearchBar class

Constructors

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 setterinherited
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 setterinherited
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

Methods

beginSearch(dynamic context) → void
Initializes the search bar.
build(BuildContext context) AppBar?
Returns an AppBar based on the value of isSearching
buildAppBar(BuildContext context) AppBar?
Builds, saves and returns the default app bar.
buildSearchBar(BuildContext context) AppBar
Builds the search bar!
getSearchAction(BuildContext context) IconButton
Returns an IconButton suitable for an Action
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited