ZdsSearchField class
A search field that can be used in a Form.
This component can be used to update search results in two ways. onChange can be used to update the search results as the user types their query without needing to be submitted through the press of a button. If the search requires a lookup that will take time, you can instead only use onSubmit to only query results when the user presses the search button on their keyboard.
See also:
- ZdsSearchAppBar, an appBar that uses this component.
- ZdsEmpty, which can be used to show a no results message.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ZdsSearchField
- Available extensions
Constructors
- ZdsSearchField({Key? key, Key? textFormFieldKey, ZdsSearchFieldVariant variant = ZdsSearchFieldVariant.elevated, void onChange(String value)?, String? initValue, String? hintText, void onSubmit(String value)?, FocusNode? focusNode, EdgeInsets padding = const EdgeInsets.all(12), Widget? suffixIcon, TextEditingController? controller, TextInputAction inputAction = TextInputAction.search})
-
A search field that can be used in a form.
const
Properties
- controller → TextEditingController?
-
A controller that can be used to notify listeners when the text changes.
final
- focusNode → FocusNode?
-
The focusNode for the search field.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hintText → String?
-
Hint text that will appear when the user hasn't written anything in the search field.
final
- initValue → String?
-
Optional pre-filled text.
final
- inputAction → TextInputAction
-
The input action that will be shown on the keyboard when the user interacts with this search field.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onChange → void Function(String value)?
-
Callback called whenever the search field's text changes.
final
- onSubmit → void Function(String value)?
-
Callback called whenever the user presses the 'Search' button on their keyboard.
final
- padding → EdgeInsets
-
Empty space to inscribe around this widget.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- suffixIcon → Widget?
-
A widget to show at the end of the search field, after the editable text area.
final
- textFormFieldKey → Key?
-
The Key to use for the underlying TextFormField.
final
- variant → ZdsSearchFieldVariant
-
Which variant to use.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's 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.
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}) → 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