SearchableAppBarTitle class
A widget that provides a searchable app bar title with animated transitions.
This widget can switch between displaying a title and a search text field with smooth animations. It's commonly used in app bars where users can toggle between viewing the title and searching for content.
Usage:
SearchableAppBarTitle(
isSearching: isSearching,
searchController: searchController,
searchFocus: searchFocus,
onSubmitted: (query) {
// Handle search query
},
title: 'My Page',
searchHint: 'Search...',
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SearchableAppBarTitle
Constructors
- SearchableAppBarTitle({Key? key, required bool isSearching, required TextEditingController searchController, required FocusNode searchFocus, required dynamic onSubmitted(String), required String title, required String searchHint})
-
Creates a SearchableAppBarTitle widget.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isSearching → bool
-
Whether the widget is currently in search mode.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onSubmitted → dynamic Function(String)
-
Callback function called when the search query changes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchController → TextEditingController
-
The text editing controller for the search field.
final
- searchFocus → FocusNode
-
The focus node for the search text field.
final
- searchHint → String
-
The hint text displayed in the search field when it's empty.
final
- title → String
-
The title text to display when not in search mode.
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