SearchBarThemeData class

Defines default property values for descendant SearchBar widgets.

Descendant widgets obtain the current SearchBarThemeData object using SearchBarTheme.of(context). Instances of SearchBarThemeData can be customized with SearchBarThemeData.copyWith.

Typically a SearchBarThemeData is specified as part of the overall Theme with ThemeData.searchBarTheme.

All SearchBarThemeData properties are null by default. When null, the SearchBar will use the values from ThemeData if they exist, otherwise it will provide its own defaults based on the overall Theme's colorScheme. See the individual SearchBar properties for details.

See also:

  • ThemeData, which describes the overall theme information for the application.
Mixed-in types
Annotations

Constructors

SearchBarThemeData({WidgetStateProperty<double?>? elevation, WidgetStateProperty<Color?>? backgroundColor, WidgetStateProperty<Color?>? shadowColor, WidgetStateProperty<Color?>? surfaceTintColor, WidgetStateProperty<Color?>? overlayColor, WidgetStateProperty<BorderSide?>? side, WidgetStateProperty<OutlinedBorder?>? shape, WidgetStateProperty<EdgeInsetsGeometry?>? padding, WidgetStateProperty<TextStyle?>? textStyle, WidgetStateProperty<TextStyle?>? hintStyle, BoxConstraints? constraints, TextCapitalization? textCapitalization})
Creates a theme that can be used for ThemeData.searchBarTheme.
const

Properties

backgroundColor WidgetStateProperty<Color?>?
Overrides the default value of the SearchBar.backgroundColor.
final
constraints BoxConstraints?
Overrides the value of size constraints for SearchBar.
final
elevation WidgetStateProperty<double?>?
Overrides the default value of the SearchBar.elevation.
final
hashCode int
The hash code for this object.
no setteroverride
hintStyle WidgetStateProperty<TextStyle?>?
Overrides the default value for SearchBar.hintStyle.
final
overlayColor WidgetStateProperty<Color?>?
Overrides the default value of the SearchBar.overlayColor.
final
padding WidgetStateProperty<EdgeInsetsGeometry?>?
Overrides the default value for SearchBar.padding.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowColor WidgetStateProperty<Color?>?
Overrides the default value of the SearchBar.shadowColor.
final
shape WidgetStateProperty<OutlinedBorder?>?
Overrides the default value of the SearchBar.shape.
final
side WidgetStateProperty<BorderSide?>?
Overrides the default value of the SearchBar.side.
final
surfaceTintColor WidgetStateProperty<Color?>?
Overrides the default value of the SearchBar.surfaceTintColor.
final
textCapitalization TextCapitalization?
Overrides the value of SearchBar.textCapitalization.
final
textStyle WidgetStateProperty<TextStyle?>?
Overrides the default value for SearchBar.textStyle.
final

Methods

copyWith({WidgetStateProperty<double?>? elevation, WidgetStateProperty<Color?>? backgroundColor, WidgetStateProperty<Color?>? shadowColor, WidgetStateProperty<Color?>? surfaceTintColor, WidgetStateProperty<Color?>? overlayColor, WidgetStateProperty<BorderSide?>? side, WidgetStateProperty<OutlinedBorder?>? shape, WidgetStateProperty<EdgeInsetsGeometry?>? padding, WidgetStateProperty<TextStyle?>? textStyle, WidgetStateProperty<TextStyle?>? hintStyle, BoxConstraints? constraints, TextCapitalization? textCapitalization}) SearchBarThemeData
Creates a copy of this object but with the given fields replaced with the new values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
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
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

lerp(SearchBarThemeData? a, SearchBarThemeData? b, double t) SearchBarThemeData?
Linearly interpolate between two SearchBarThemeDatas.