SearchBar<T> class

Inheritance

Constructors

Properties

buildSuggestion → (Widget Function(T? item, int index)?)
Callback returning the widget corresponding to a Suggestion item
final
cancellationWidget Widget
Widget shown for cancellation
final
crossAxisCount int
Number of items displayed on cross axis
final
crossAxisSpacing double
Spacing between tiles on cross axis
final
debounceDuration Duration
Cooldown between each call to avoid too many
final
emptyWidget Widget
Widget to show when no item were found
final
hashCode int
The hash code for this object.
no setterinherited
Widget placed between the search bar and the results
final
headerPadding EdgeInsetsGeometry
Set a padding on the header
final
hintStyle TextStyle
TextStyle of the hint text
final
hintText String
Hint text of the search bar
final
icon Widget
Widget showed on left of the search bar
final
iconActiveColor Color
Color of the icon when search bar is active
final
indexedScaledTileBuilder IndexedScaledTileBuilder?
Called to get the tile at the specified index for the SliverGridStaggeredTileLayout.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listPadding EdgeInsetsGeometry
Set a padding on the list
final
loader Widget
Widget to show when loading
final
mainAxisSpacing double
Spacing between tiles on main axis
final
minimumChars int
Minimum number of chars required for a search
final
onCancelled VoidCallback?
Callback when cancel button is triggered
final
onError → (Widget Function(Error error)?)
Callback returning the widget corresponding to an Error while searching
final
onItemFound Widget Function(T? item, int index)
Callback returning the widget corresponding to an item found
final
onSearch Future<List<T>> Function(String? text)
Future returning searched items
final
placeHolder Widget?
Widget to show by default
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollDirection Axis
Set the scrollDirection
final
searchBarController SearchBarController?
Controller used to be able to sort, filter or replay the search
final
searchBarPadding EdgeInsetsGeometry
Set a padding on the search bar
final
searchBarStyle SearchBarStyle
Enable to edit the style of the search bar
final
shrinkWrap bool
Weather the list should take the minimum place or not
final
suggestions List<T>
List of items showed by default
final
textStyle TextStyle
Text style of the text in the search bar
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _SearchBarState
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