FloatingSearchAppBar class
An AppBar with implemented search functionality and other utility functions to implement a material behavior.
This can be considered the base Widget for the full FloatingSearchBar.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FloatingSearchAppBar
Constructors
-
FloatingSearchAppBar({Key? key, Duration implicitDuration = const Duration(milliseconds: 500), Curve implicitCurve = Curves.linear, required Widget? body, Color? accentColor, Color? color, Color? colorOnScroll, Color? shadowColor, Color? iconColor, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? insets, double? height = 56.0, double? elevation = 0.0, double liftOnScrollElevation = 4.0, TextStyle? hintStyle, TextStyle? titleStyle, Brightness? brightness, Widget? bottom, bool showCursor = true, bool alwaysOpened = false, bool clearQueryOnClose = true, bool automaticallyImplyDrawerHamburger = true, bool hideKeyboardOnDownScroll = false, bool automaticallyImplyBackButton = true, dynamic progress = 0.0, Duration transitionDuration = const Duration(milliseconds: 500), Curve transitionCurve = Curves.easeOut, Duration debounceDelay = Duration.zero, Widget? title, String? hint = 'Search...', List<
Widget> ? actions, List<Widget> ? leadingActions, OnQueryChangedCallback? onQueryChanged, OnQueryChangedCallback? onSubmitted, OnFocusChangedCallback? onFocusChanged, FloatingSearchBarController? controller, TextInputAction textInputAction = TextInputAction.search, TextInputType textInputType = TextInputType.text, bool autocorrect = true, ToolbarOptions? toolbarOptions, ValueChanged<KeyEvent> ? onKeyEvent}) -
const
Properties
- accentColor → Color?
-
The accent color used for example for the
progress indicator
final
-
actions
→ List<
Widget> ? -
A list of widgets displayed in a row after the TextField.
final
- alwaysOpened → bool
-
Whether the bar should be always in opened state.
final
- autocorrect → bool
-
Enable or disable autocorrection of the TextField of
this
FloatingSearchBar
.final - automaticallyImplyBackButton → bool
-
Whether to automatically display a back button if the enclosing route
can be popped.
final
- automaticallyImplyDrawerHamburger → bool
-
Whether a hamburger menu should be shown when
there is a Scaffold with a Drawer in the widget
tree.
final
- body → Widget?
-
The widget displayed below the FloatingSearchAppBar
final
- bottom → Widget?
-
final
- brightness → Brightness?
-
The Brightness that is used for adjusting the
status bar icon brightness.
final
- clearQueryOnClose → bool
-
Whether the current query should be cleared when
the
FloatingSearchBar
was closed.final - color → Color?
-
The background color of the bar
final
- colorOnScroll → Color?
-
The color of the bar when a Scrollable
inside the body was scrolled (i.e. is not at the top)
final
- controller → FloatingSearchBarController?
-
The controller for this
FloatingSearchBar
which can be used to programatically open, close, show or hide theFloatingSearchBar
.final - curve → Curve
-
finalinherited
- debounceDelay → Duration
-
The delay between the time the user stopped typing
and the invocation of the onQueryChanged callback.
final
- duration → Duration
-
finalinherited
- elevation → double?
-
The elevation of the bar
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
The height of the bar
final
- hideKeyboardOnDownScroll → bool
-
Hides the keyboard a Scrollable inside the body was scrolled and
shows it again when the user scrolls to the top.
final
- hint → String?
-
The text value of the hint of the TextField.
final
- hintStyle → TextStyle?
-
The TextStyle for the hint of the input field
final
- iconColor → Color?
-
Can be used to override the
IconThemeDatas
colorfinal - insets → EdgeInsetsGeometry?
-
The horizontal spacing between leadingActions, the input
field and actions
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
leadingActions
→ List<
Widget> ? -
A list of widgets displayed in a row before the TextField.
final
- liftOnScrollElevation → double
-
The elevation of the bar when a Scrollable
inside the body was scrolled (i.e. it's not at the top)
final
- onFocusChanged → OnFocusChangedCallback?
-
A callback that gets invoked when the
FloatingSearchBar
receives or looses focus.final -
onKeyEvent
→ ValueChanged<
KeyEvent> ? -
final
- onQueryChanged → OnQueryChangedCallback?
-
A callback that gets invoked when the input of
the query inside the TextField changed.
final
- onSubmitted → OnQueryChangedCallback?
-
A callback that gets invoked when the user submitted
their query (e.g. hit the search button).
final
- padding → EdgeInsetsGeometry?
-
The padding of the bar
final
- progress → dynamic
-
The progress of the LinearProgressIndicator inside the bar.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadowColor → Color?
-
The shadow color for the elevation
final
- showCursor → bool
-
to show the cursor or not
final
- textInputAction → TextInputAction
-
The TextInputAction to be used by the TextField
of this
FloatingSearchBar
.final - textInputType → TextInputType
-
The TextInputType of the TextField
of this
FloatingSearchBar
.final - title → Widget?
-
A widget that is shown in place of the TextField when the
FloatingSearchBar
is closed.final - titleStyle → TextStyle?
-
The TextStyle for the title of the bar
final
- toolbarOptions → ToolbarOptions?
-
The ToolbarOptions of the TextField of
this
FloatingSearchBar
.final - transitionCurve → Curve
-
The curve for the animation between opened and closed
state.
final
- transitionDuration → Duration
-
The duration of the animation between opened and closed
state.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → FloatingSearchAppBarState -
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}) → 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
Static Methods
-
of(
BuildContext context) → FloatingSearchAppBarState?