SmartSearchBox<T> class

A search box widget that connects to a SmartPaginationCubit for searching.

This widget provides a text field that triggers search operations on the connected cubit when the user types.

Example:

SmartSearchBox<Product>(
  controller: searchController,
  decoration: InputDecoration(
    hintText: 'Search products...',
    prefixIcon: Icon(Icons.search),
  ),
)
Inheritance

Constructors

SmartSearchBox({Key? key, required SmartSearchController<T> controller, InputDecoration? decoration, TextStyle? style, TextCapitalization textCapitalization = TextCapitalization.none, TextInputAction textInputAction = TextInputAction.search, TextInputType keyboardType = TextInputType.text, ValueChanged<String>? onSubmitted, VoidCallback? onTap, bool enabled = true, bool readOnly = false, bool showClearButton = true, Widget clearButtonBuilder(VoidCallback onClear)?, Widget? prefixIcon, Widget? suffixIcon, EdgeInsetsGeometry? contentPadding, bool? filled, Color? fillColor, BorderRadius? borderRadius, InputBorder? border, InputBorder? focusedBorder, InputBorder? enabledBorder})
const

Properties

border InputBorder?
Default border.
final
borderRadius BorderRadius?
Border radius for the text field.
final
clearButtonBuilder Widget Function(VoidCallback onClear)?
Custom builder for the clear button.
final
contentPadding EdgeInsetsGeometry?
Padding for the content inside the text field.
final
controller SmartSearchController<T>
The search controller managing this search box.
final
decoration InputDecoration?
Decoration for the text field.
final
enabled bool
Whether the text field is enabled.
final
enabledBorder InputBorder?
Border when enabled but not focused.
final
fillColor Color?
Background fill color.
final
filled bool?
Whether to fill the text field background.
final
focusedBorder InputBorder?
Border when focused.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType
The type of keyboard to display.
final
onSubmitted ValueChanged<String>?
Called when the user submits the search (e.g., presses Enter).
final
onTap VoidCallback?
Called when the text field is tapped.
final
prefixIcon Widget?
Icon to show at the start of the text field.
final
readOnly bool
Whether the text field is read-only.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showClearButton bool
Whether to show a clear button when there's text.
final
style TextStyle?
Text style for the search input.
final
suffixIcon Widget?
Icon to show at the end of the text field (before clear button).
final
textCapitalization TextCapitalization
Text capitalization behavior.
final
textInputAction TextInputAction
The action button on the keyboard.
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.
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