AutoSuggestBox<T> class

An AutoSuggestBox provides a list of suggestions for a user to select from as they type.

AutoSuggestBox Preview

See also:

Inheritance

Constructors

AutoSuggestBox({Key? key, required TextEditingController controller, required List<T> items, AutoSuggestBoxItemBuilder<T>? itemBuilder, AutoSuggestBoxItemSorter sorter = defaultItemSorter, WidgetBuilder noResultsFound = defaultNoResultsFound, AutoSuggestBoxTextBoxBuilder<T> textBoxBuilder = defaultTextBoxBuilder, ValueChanged<T>? onSelected})
Creates a fluent-styled auto suggest box.
const

Properties

controller → TextEditingController
The controller used to have control over what to show on the TextBox.
final
hashCode → int
The hash code for this object.
no setterinherited
itemBuilder → AutoSuggestBoxItemBuilder<T>?
The item builder to build items. If null, uses a default internal builder
final
items → List<T>
The list of items to display to the user to pick. If empty, noResultsFound is used.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
noResultsFound → WidgetBuilder
The widget to show when the text the user typed doesn't match with itemss. defaultNoResultsFound is used by default.
final
onSelected → ValueChanged<T>?
Called when the user selected a value.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sorter → AutoSuggestBoxItemSorter
Sort the items to show. defaultItemSorter is used by default
final
textBoxBuilder → AutoSuggestBoxTextBoxBuilder<T>
Build the text box. defaultTextBoxBuilder is used by default
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _AutoSuggestBoxState<T>
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.
override
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, int wrapWidth = 65}) → 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

Static Methods

defaultItemSorter<T>(String text, List items) → List
defaultNoResultsFound(dynamic context) → Widget
Creates a 'No results found' tile.
defaultTextBoxBuilder(BuildContext context, TextEditingController controller, FocusNode focusNode, GlobalKey<State<StatefulWidget>> key) → Widget