AppSearchField class

A search field with clear and submit actions.

Inheritance

Constructors

AppSearchField({Key? key, TextEditingController? controller, String hintText = 'Search...', ValueChanged<String>? onChanged, ValueChanged<String>? onSubmitted, VoidCallback? onClear, Widget? prefixIcon = const Icon(Icons.search), bool enabled = true, bool autofocus = false, Color? backgroundColor, double? borderRadius, Color? borderColor, double? borderWidth, Color? focusedBorderColor, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, TextStyle? textStyle, TextStyle? hintStyle, Color? cursorColor})
Creates a search field.
const

Properties

autofocus bool
Whether to autofocus the field.
final
backgroundColor Color?
Optional background color.
final
borderColor Color?
Optional border color.
final
borderRadius double?
Optional border radius.
final
borderWidth double?
Optional border width.
final
controller TextEditingController?
Controller for the search field.
final
cursorColor Color?
Optional cursor color.
final
enabled bool
Whether the field is enabled.
final
focusedBorderColor Color?
Optional focused border color.
final
hashCode int
The hash code for this object.
no setterinherited
hintStyle TextStyle?
Optional hint style.
final
hintText String
Hint text displayed when the field is empty.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry?
Optional margin.
final
onChanged ValueChanged<String>?
Called when the search text changes.
final
onClear VoidCallback?
Called when the user clears the search.
final
onSubmitted ValueChanged<String>?
Called when the user submits the search.
final
padding EdgeInsetsGeometry?
Optional padding.
final
prefixIcon Widget?
Icon displayed at the start of the field.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textStyle TextStyle?
Optional text style.
final

Methods

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