SubZeroSearchField class

A robust, accessible search input field following the SubZero 2.0 Design System.

Features:

  • Leading search icon (magnifying glass)
  • Clear 'X' icon that appears when text is entered
  • Optional trailing microphone icon for voice search
  • Rounded pill shape with light gray background
  • Callbacks for query submission and text changes

Example usage:

SubZeroSearchField(
  hintText: 'Search here',
  onSubmitted: (query) => performSearch(query),
  onChanged: (text) => updateSuggestions(text),
)
Inheritance
Available extensions

Constructors

SubZeroSearchField({Key? key, String hintText = 'Search here', ValueChanged<String>? onSubmitted, ValueChanged<String>? onChanged, VoidCallback? onFocused, VoidCallback? onCleared, VoidCallback? onMicrophoneTap, bool showMicrophone = true, String? initialValue, TextEditingController? controller, FocusNode? focusNode, SubZeroSearchSize size = SubZeroSearchSize.medium, bool enabled = true, bool autofocus = false, Color? backgroundColor, Color? focusedBorderColor})
const

Properties

autofocus → bool
Whether to autofocus on mount
final
backgroundColor → Color?
Background color override
final
controller → TextEditingController?
External controller (if not provided, internal one is used)
final
enabled → bool
Whether the field is enabled
final
focusedBorderColor → Color?
Border color when focused
final
focusNode → FocusNode?
External focus node (if not provided, internal one is used)
final
hashCode → int
The hash code for this object.
no setterinherited
hintText → String
Placeholder text when the field is empty
final
initialValue → String?
Initial text value
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged → ValueChanged<String>?
Callback when text changes
final
onCleared → VoidCallback?
Callback when clear button is tapped
final
onFocused → VoidCallback?
Callback when the field gains focus
final
onMicrophoneTap → VoidCallback?
Callback when microphone button is tapped (voice search)
final
onSubmitted → ValueChanged<String>?
Callback when user submits the query (presses Enter)
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showMicrophone → bool
Whether to show the microphone icon
final
size → SubZeroSearchSize
Size preset for the search field
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<SubZeroSearchField>
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
withCountBadge({required int count, int maxCount = 99, SubZeroBadgeStyle style = SubZeroBadgeStyle.filled, SubZeroBadgeSize size = SubZeroBadgeSize.medium, SubZeroBadgeAlignment alignment = const SubZeroBadgeAlignment(), bool show = true}) → Widget

Available on Widget, provided by the SubZeroBadgeExtension extension

Wrap this widget with a count badge
withDotBadge({SubZeroBadgeStyle style = SubZeroBadgeStyle.filled, SubZeroBadgeSize size = SubZeroBadgeSize.medium, SubZeroBadgeAlignment alignment = const SubZeroBadgeAlignment(), bool show = true}) → Widget

Available on Widget, provided by the SubZeroBadgeExtension extension

Wrap this widget with a dot badge

Operators

operator ==(Object other) → bool
The equality operator.
inherited