AsyncSearchBase<T extends Object> class abstract

The base class for async search fields.

Inheritance
Implementers

Constructors

AsyncSearchBase({Key? key, required AsyncSearchCallback<T>? search, required AsyncPagedSearchCallback<T>? pagedSearch, required ValueChanged<List<T>>? onResults, Duration debounce = const Duration(milliseconds: 600), required AsyncSearchBuilder<T> builder, required AsyncSearchViewBuilder viewBuilder, WidgetBuilder loadingBuilder = defaultLoadingBuilder, WidgetBuilder? emptyBuilder, Widget errorBuilder(BuildContext context, Object error, StackTrace stackTrace)? = defaultErrorBuilder, WidgetBuilder? scrollLoadingBuilder, TextEditingController? controller, bool enabled = true, bool readOnly = false})
Creates a base class for async search fields.
const

Properties

builder AsyncSearchBuilder<T>
The builder to show and select each search result.
final
controller TextEditingController?
Controls the text being edited.
final
debounce Duration
The debounce duration to wait before calling each search function.
final
emptyBuilder WidgetBuilder?
The view builder to show when results are empty. If null, shows nothing.
final
enabled bool
Whether the field is enabled or disabled.
final
errorBuilder Widget Function(BuildContext context, Object error, StackTrace stackTrace)?
The view builder to show when an error occurs. If null, shows nothing.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder WidgetBuilder
The loading builder to show while searching.
final
onResults ValueChanged<List<T>>?
The results of the search.
final
pagedSearch AsyncPagedSearchCallback<T>?
The paged search function to call when the user types in the search field.
final
readOnly bool
Whether the field is read-only.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollLoadingBuilder WidgetBuilder?
The loading builder to show while scrolling.
final
The search function to call when the user types in the search field.
final
viewBuilder AsyncSearchViewBuilder
The view that will hold the search results of builder.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
inherited
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, 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

defaultErrorBuilder(BuildContext context, Object error, StackTrace stackTrace) Widget
The default error builder to show when an error occurs.
defaultLoadingBuilder(BuildContext context) Widget
The default loading builder to show while searching.